Rotation around an axis

I have a character controller with an arbitrary orientation, in other words not standing straight up. I know the direction in the world space of the Y-axis of the controller and want rotate the controller around that axis. Shouldn’t I be able to do that with Quaternion.RotationAxis? When I use that function the resulting rotation is not around the axis as the axis is also rotated off the original direction.

You can use Quaternion.Euler(x, y, z) to get rotation around around Y axis and set it to the actor.

1 Like

What I have been trying to do is create a third person point of view character who walks around on sphere like a small planet. While I have had a little luck getting the character to maintain a perpendicular stance relative to the surface as the character moves across the surface it seems that the capsule collider is not rotating with the character controller. The character sinks into the surface and stops as it approaches a quarter of the circumference of the sphere.