generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Brick Touching Another Brick

Previous Thread :: Next Thread 
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
05 Sep 2013 08:33 PM
Is there an event that can tell if a brick is touching another brick? Both bricks would be anchored, but using the Touched event won't work. Here is an example script that doesn't work. Brick is 5 studs below checkpoint exactly.


local brick = game.Workspace.Brick
local checkpoint = game.Workspace.Checkpoint
debounce = true

while debounce do
brick.CFrame = brick.CFrame * CFrame.new(0, .1, 0)
wait()
end

checkpoint.Touched:connect(function (hit)
if hit.Parent == "Brick" then
debounce = false
end
end)

This doesn't work for sure, but is there any other way?
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
05 Sep 2013 08:59 PM
Bump...
Report Abuse
electricpretzel0 is not online. electricpretzel0
Joined: 30 Sep 2008
Total Posts: 1278
05 Sep 2013 09:10 PM
if too unachored bricks touch each others you can write a if statement to check if the brick it hit is "whatever brick" Idk what you're trying to do with this.
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
05 Sep 2013 09:12 PM
local brick = game.Workspace.Brick
local checkpoint = game.Workspace.Checkpoint
debounce = true

checkpoint.Touched:connect(function (hit)
debounce = not hit.Parent == 'Brick'
end)

while debounce do
brick.CFrame = brick.CFrame * CFrame.new(0, .1, 0)
wait()
end
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
06 Sep 2013 08:34 AM
That doesn't work, even when I edited it. It won't work since the Touched event doesn't seem to capture whether an anchored brick is being hit by another anchored brick that's being CFramed.
Report Abuse
brinkokevin is not online. brinkokevin
Joined: 25 Jul 2012
Total Posts: 1673
06 Sep 2013 10:12 AM
try hit.Parent.Name


local brick = game.Workspace.Brick
local checkpoint = game.Workspace.Checkpoint
debounce = true

while debounce do
brick.CFrame = brick.CFrame * CFrame.new(0, .1, 0)
wait()
end

checkpoint.Touched:connect(function (hit)
if hit.Parent.Name == "Brick" then
debounce = false
end
end)
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
06 Sep 2013 12:49 PM
god... learn to script before you help.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image