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

Part won't fall on touch?

Asked by 10 years ago

Okay so I've tried SO MANY different scripts for this but nothing seems to work....

I want a part to fall when it is touched by another part (a ball to be exact; it is the bullet that is shot out of a gun, but it disappears after a few seconds). Anyway, for whatever reason the part refuses to fall when touched by the ball, and i have no idea why! The output never says anything is wrong, and I am at a loss to what the problem is here.

Here is the most recent script I've used:

Workspace.Spark.Touched:connect(function(part)
    if part.Name == "Fallpart" then
        part.Anchored = false
    end
end)

I really appreciate any help!

2 answers

Log in to vote
1
Answered by 10 years ago

What your script does it that when the part Workspace.Spark is touched by Fallpart, Fallpart is unanchored. Should it not be the other way round ?

theStaticPart.Touched:connect(function()
        theStaticPart.Anchored = false
end)
0
No, the Fallpart is the part I want to fall while Spark is the ball that I want to hit it. ethanw89 0 — 10y
0
Does the part even unanchor ? Is the if statement triggered ? (check with prints) Hippalectryon 3 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

You're going about this incorrectly.

You will want the script to be in the part that gets touched by the spark, because that's where the Touched event fires more reliably.

So put this script in the Fallpart.

script.Parent.Touched:connect(function(hit)
    if hit.Name == "Spark" then
        script.Parent.Anchored = false
    end
end)
0
That did not work either >=/ man, this is really frustrating me! Here are some images of me shooting the supposed-to-be-falling part: [this](http://i.imgur.com/IyGMT85.png) and [this](http://i.imgur.com/2xFXPCc.png) ethanw89 0 — 10y

Answer this question