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
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
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)