- Home /
Inconsistency in Rigidbody.MovePosition
Hi, I believe I have gone extremely wrong somewhere or I have found some sort of bug. Probably the former. Basically, I have two Rigidbody.MovePosition instances that both do different things when called.
function FixedUpdate () {
rb.MovePosition(transform.position + transform.forward * -thrust * Time.deltaTime);
print (-thrust * Time.deltaTime);
if (Input.GetAxis("Accelerate") != 0)
{
rb.MovePosition(transform.position + transform.forward * -thrust * Time.deltaTime);
}
}
(This is a simplified version of my script but I am sure the rest has nothing to do with this except for setting the rb variable as a rigidbody).
When I press the accelerate button, the rigidbody moves. But, if I am not pressing the button it does not move. FixedUpdate should be called every physics update but it is not moving the object. When I use print, it returns "-0.6" yet doesn't move.
Any and all help is appreciated.
You really should use Time.fixedDeltaTime when using FixedUpdate()
Your answer
Follow this Question
Related Questions
Shake Effect 0 Answers
Rigidbody Position Changes don't work when moving. 0 Answers
Rigidbody.MovePosition not behaving as expected (possible bug?) 1 Answer
Rigidbody MovePosition doesnt use continous dynamic setting 1 Answer
Rigidbody.MovePosition() is not working if transform.position is just changed 1 Answer