- Home /
Question regarding - Quaternion.FromToRotation, Walking around a cube
So i'm really stuck on this one,
Im trying to set up a behaviour which allows players to walk on the walls of a cube.
So far this works when I jump from the ground to the cube., I alight my referent up, to the hit.normal of a Racast, like this:
newRot = Quaternion.FromToRotation (at.myArmor.up, currentNormal);
But I cannot get it to work, when I jump from one side of the cube unto another. The rotation goes wierd. The up, is no longer perpendicular to the Cube
Any ideas how i can fix this?
Here is an image,
When I jump unto it, it works, it preserved the x and z rotation
Then when I change from one side to another, it is no longer perpendicular
Your answer
Follow this Question
Related Questions
eulerAngles not set to zero. 1 Answer
Quaternion rotation with normals bug: Only works into one direction? 1 Answer
Commands affecting rotation not working 1 Answer
Is there no way to get reliable angles from a rigidbody? 2 Answers
How to get Angle float of specific axis.(Turret clamping related). 2 Answers