- Home /
Rigidbody2D and AddForceAtPosition
Im trying to make a rocket, and im using an empty gameobject parented to the rocket for the motor position, the point where the force will be applied, here is my code: motorPivot = GameObject.FindGameObjectWithTag("motorPivot").transform.position; rigidbody2D.AddForceAtPosition(transform.up * force,motorPivot); Even with the motorPivot exactly equal to the transform.position of the rocket, im getting diferent results when i put transform.position instead of the motorPivot. With transform.position, the rocket move upwards regardless of the world pos of the rocket (that is correct). With the motorPivot (wich is exactly the same values of the transform.position), the rocket slight rotate twards the center of the world.
Whats wrong?
Answer by vinicius47 · Jul 11, 2014 at 05:29 PM
I figured out whats wrong, i have to update the motorPivot position inside the FixedUpdate, with the addForce.
Your answer
Follow this Question
Related Questions
move 2d character affected by physics with velocity and/or add force 2 Answers
Jump Height Different On Android 0 Answers
Rigidbody2d.addforce in the direction of mouse problem 1 Answer
2D Rotate towards GameObject acting odd. 2 Answers
Unity 2019.3.0f6 - Trouble with physics, cubes turn left after some meters 1 Answer