AddForce

Why we used rb.addrelativeforce instead of rb.addforce ? what will be the difference

AddRelativeForce adds force relative to the object’s coordinate system. That is it’s local space. AddForce adds force in world space. If you AddForce in the Vector3.up direction, it will be ‘up’ relative to everything, i.e. the top of the screen. AddRelativeForce in the Vector3.up direction is towards the rocket’s top, no matter how it is rotated. We want the rocket to go towards its top, not the screen’s top.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms