Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make an object disappear when it collides with another object?

Asked by 8 years ago

So I've been wondering how you'd put this into code v

if BrickA collides with BrickB then/ if BrickA touches BrickB then

What would you replace "touches"/"collides with" with? You don't need to tell me how you'd make the object disappear because I already have that part down...

1 answer

Log in to vote
1
Answered by 8 years ago
function Check(hit)
    if hit.ClassName == "Part" then
        script.Parent.Transparency = 1
    end
end

script.Parent.Touched:connect(Check)
0
The part will still exist and be interacted with by any part, it will just be invisible. Marios2 360 — 8y
0
Thanks..and don't worry. I have the rest down already. secretboy6 68 — 8y
Ad

Answer this question