Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I add detection to my moving part?

How can I make detection when something moving, I mean when something is unanchored and it moving script detecting this.

1 answer

✓ Accepted answer

you can use a while loop and continuously check the velocity of the part

local part = path.to.part

while true do
	if part.Velocity.Magnitude > 0.1 and not part.Anchored then -- magnitude is the length of a vector
		print("part is moving")
	else
		print("part is not moving")
	end
	wait()
end

1 comment

0

It's working, thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.