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

Is there a way to get more precise .Touched function?

Asked by 7 years ago

I'm trying to make a script where when you are on the pad, a gui appears, then when you jump or walk off of it, it disappears. The problem is, every frame while you are walking, both your right and your left leg touch it alternatively and stop, which makes it constantly spazz out from on-off-on-off-on-off, would there be a way to fix it so when you are on the pad, even if you are moving, unless you jumped or walked off to make it stop doing that?

1 answer

Log in to vote
0
Answered by 7 years ago

You could try and get the distance from the player to the pad everytime the touchended function is called using Vector3s. If the distance is greater than a certain number (Keep in mind this will go to the center of the pad), then it'll destroy the gui.

Ad

Answer this question