Hi so I’m getting a bit of a headache here trying to figure out what the x y and z parts are of the hit.normal when there is OnControllerCollderHit(ControllerColliderHit hit) collision. Basically, when the controller is on flat ground, the values are x = 0, y = 1, z = 0. So it looks like it’s a quaternion rotation (not in degrees), but it’s in a Vector3. How would I go about transforming that Vector3 back into the Quaternion rotation? (that doesn’t just rotate 1 degree about the y axis) Thanks for your help!
Hit.normal (and almost all normals for that matter), is a direction, not a rotation. What the (0,1,0) is telling you here is not a rotation on the y axis but actually the direction y=1, which is straight up. On an angled surface, you might get something more like (1,1,0), which would be a rotation of about 45 degrees on the z axis. When you are thinking about a Vector that is used as a direction, rather than a position, think of it as the direction a ray would point if it started at the origin and pointed to the point (x,y,z). If you want to turn this into a rotation, you will need to have another direction as a reference point (let’s say, straight up, or (0,1,0)). Then, use Quaternion.SetFromToRotation to find the rotation. Remember, the normal itself is a direction.
Also in the future, you should probably give a more descriptive title.
Hope this helps!