I've implemented a spell casting system where my character always faces where he is casting. This some times makes his y rotation change when he's casting upwards (flying enemy etc). I would like to reset his rotation to "stand straight" on the ground when I start moving again.
I've tried this:
transform.rotation = Quaternion.FromToRotation(transform.up, Vector3.up);
Believing this would make his current rotation align with the top of the world. Why is this not working and what would be the correct way to do this?
↧