Hello, I’m trying to make a 3rd person character controller that works on a planet. I have created 2 rotations, one rotates around the character using standard mouse input (to look left and right), and the other rotation is used to make it seem like the player is always on a flat surface no matter where they are on the planet.
var mouseRotation = Quaternion.AngleAxis(yTargetRotation, Vector3.up);
var planetRotation = Quaternion.FromToRotation(transform.up, transform.position);
var finalRotation = ?;
transfrom.rotation = finalRotation;
Rundown
- yTargetRotation is total “Mouse X” input over the frames
- it takes the character’s green arrow (transfrom.up) and points it so it faces away from the origin
- ? I need help combining 1 and 2
- set the rotation to final rotation.