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

Why doesn't .Changed fire when a part.Position is changed?

Asked by 8 years ago

I am making a local script that will close a Gui when a player gets so far from a block but the .Changed event is not firing on the player.Character.Torso when they move, I know I could just use a while loop but I find those inefficient.

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

Changed is only fired when a value is set. There is no event to detect movement. You can use DistanceFromCharacter to tell how far away the character is in a while loop, and make sure that it is not equal to 0.

0
Yeah but I was hoping there was a better way that a while loop but I guess I'm just going to have to except it. BobserLuck 367 — 8y
Ad

Answer this question