# How would I go about finding the rotation corrresponding to the force added to the y and z axis of a object?

Heyo! I am working on a puzzle game project and in this game I have jump pads that pull you off the ground, what I need to figure out is the rotation at which the character(player) is being shot off the ground, what I have is pretty basic right now as far as getting off the ground goes, it is just adding force to the rigidbody on Y by the variable forcePower and on Z by how fast the character is going. I need to find the rotation that would put his local y axis in the same direction as he is being forced.

Thanks for the help in advance!

After you’ve added the force, this will align the local ‘Y’ with the velocity:

``````var q = Quaternion.FromToRotation(transform.up, rigidbody.velocity);
transform.rotation = q * transform.rotation;
``````

This will likely also work:

``````transform.up = rigidbody.velocity;
``````

These code fragments align with the direction he is going. Your question says ‘being forced’. If you are trying to align with the direction of the force (not necessarily the direction he is going), then replace rigidbody.velocity with the vector you are using in AddForce().