How to get the direction vector given a point and rotation?

So basically I have the player position and its rotation value. How can I get the facing direction so i can use that for raycast.

Thank you.

1 Answer

1

You should be able to use .forward in order to raycast in the direction you are facing.

To further elaborate on this, <i>transform.forward</i> is already calculated like this by Unity: // This is already the value of transform.forward -- you don't need to actually use this transform.forward = transform.rotation * Vector3.forward;