Trying to get Camera View to Conform to Planet Surface

Hey! I have a really rough diagram of what effect I’m trying to accomplish, we’re not judging based on my artistic skills.

So basically what I have so far is a sphere that can roll around on a bigger sphere; a planet, and conforms to its “gravity” (simulating physics with gravity off, constant force towards planet center.) This sphere has a spring armed camera attached to it that the player controller can only affect the Yaw value.

My problem arises when trying to set the Pitch and Yaw values, as instead of the camera also conforming to the shape of the planet, as on the left of the given image, it remains in the same orientation. I HAVE managed to get the Pitch to match, but the Roll is more difficult.

I got the Pitch to work by using Find Look at Rotation from the center of the planet to the sphere, subtracting 90 from the Pitch and feeding that into the Spring Arm world rotation. Because Find Look at Rotation will always return 0 on Roll, as far as I can tell, there doesn’t seem to be a way that I can use Find Look at Rotation to find the Roll value that allows the Camera to stay tangential to the planet surface.

The right of the image demonstrates what the camera would be seeing. A ball rolling towards the horizon constantly. In the current program though, if the ball were to roll right or left, it would appear to start rolling down the sides of the planet as the Roll of the camera doesn’t change.

I hope this all makes sense. Basically I want to know if there’s a simple way I can keep the camera tangential to the surface of the planet in both X and Y (relative to the camera) directions, thank you.

Feel free to ask for clarifications.

Under the hood FindLookAtRotation calls MakeRotFromX

KISMET_MATH_FORCEINLINE
FRotator UKismetMathLibrary::FindLookAtRotation(const FVector& Start, const FVector& Target)
{
	return MakeRotFromX(Target - Start);
}

You should be able to replicate this using MakeRotFromY which is available to BP

RotY

Then you can do your subtracting 90 or whichever direction you need, Im assuming it might need to be +/- depending on Left/Right as positive Y will be Right. You can also GetRightVector as X vector is GetForwardVector or combine them possibly using MakeRotFromXY.