BodyPosition.ReachedTarget not doing anything

Hello devs! Soo I was experimenting with BodyPositions :

function MoveTo(pos)

script.Parent.BodyPosition.Position = pos

script.Parent.BodyPosition.ReachedTarget:Wait()

print("Reached")

end

while task.wait() do

MoveTo(Vector3.new(math.random(-100,100),3,math.random(-100,100)))

end

As you can see I wan’t to print out Reached after BodyPosition has ReachedTarget but it doesn’t seem to be doing anything :

Chances are it never reaches precisely the target? I’m not sure if there’s a magnitude range of reached target, it may need to be EXACTLY on the point in one given frame.

So how do i fix it? Should I make my own Reached function?

Mhmm! Maybe something like

repeat wait(0.1) until GetMagnitude(Pos,TargetPos) < 2

Yeah thats what I was thinking about, thanks.

1 Like