Using rigidbody.MovePosition for a pathing script but the results that occur make no sense.
Simplified script of the problem
void FixedUpdate()
{
print("position" + rigidbody.position);
rigidbody.MovePosition(new Vector3(-365.0f, 8.9f, 130.0f));
}
Returns this,
position(-365.0, 9.0, 130.0) // Initial position of object before a move
position(-365.0, 9.6, 129.9) // Random? postion after first move
position(-365.0, 8.9, 130.0) // Position it was meant to move to
I can’t understand why it flies off to some weird value for 1 iteration then goes to value it’s meant to.
-edit-
http://ninjatertle.com/dump/moveposition.unitypackage
Completely empty scene except a camera and 1 rigidbody with a script with the above code.
It oscillates on the spot between the correct position and 0.7 higher.
Only thing I can think of is there is something wrong with my exported model.