Add force to player at a certain z rotation in 2D

Hello, I want to add a force at a certain z angle(which is a moving arrow going in a circle). I have accessed the rotation of that arrow by using arrow.transform.rotation.eulerAngles.z

So now how do I add a force on the player at the above z rotation? Thanks a lot in advance!! :slight_smile:

Note: This whole project is in 2D

If you’re applying a force, you must have a Rigidbody2D so use its API and NOT the Transform. The Transform is for rendering etc. Use Rigidbody2D.rotation. It’s worth browsing the API docs for the Rigidbody2D. There you’d find Rigidbody2D.AddRelativeForce which allows you to add a force in the bodies local space. Up is the local up of the body; no need to refer to its rotation.

1 Like