Position.Changed?

I know that calling .Changed doesn’t work for physics related properties such as: CFrame or Position - But is there a more efficient way of checking if Position has changed?

Currently what I use:

While Model ~= nil do
    local LastPos = Model.PrimaryPart.Position
    wait(0.5)
    local NewPos = Model.PrimaryPart.Position
    If (LastPos - NewPos).Magnitude > 5 then
    Print("Moved")
    end
end
1 Like

That still won’t work… The OP says it, Changed doesn’t fire for physics-related properties. GetPropertyChangedSignal is almost the same as Changed except it listens to only one property.

@OlTaru You can use RunService.Heartbeat which in the developer hub:

Fires every frame after the physics simulation has completed

1 Like

Sorry I did not process something correctly in my head, I appreciate the correction with a way of checking for position changes that works.

I removed my post since it was not helpful and as you said, it would not work.

1 Like

Use Runservice.Heartbeat

This checks faster and is a more efficient way as it fires after everything is rendered each time.
You can also speed it up further by not assigning the variables at the top, and going straight to the if statement. (But the difference will be pretty neglible)