New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How can I add detection to my moving part?

Asked by 9 days ago

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

1 answer

Log in to vote
1
Answered by
Ziannea 469 Moderation Voter
9 days ago

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
0
It's working, thank you. DodusiakPL 32 — 8d
Ad

Answer this question