|
| 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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 06 Sep 2013 12:49 PM |
| god... learn to script before you help. |
|
|
| Report Abuse |
|
|