I am drawing a ray like this:
Debug.DrawRay(transform.position, new Vector3(1,1,1), Color.green, 1.0f / 60.0f);
But when i rotate the game object in x, y or z the direction of the ray is constant. I want to modify the direction so that it is relative to the game objects rotation:
I have looked at the quaternion functions and found that using something like this Quaternion.FromToRotation(transform.forward, transform.right) * new Vector3(1, 1, 1)
might do the trick. But i don’t understand what exact arguments i should give the function to make the direction rotate correctly in every axis.