How do you rotate a character so it's feet is facing a point in the world?

Don’t rotate character Roll and Pitch you should be fine, From 1st person view, Pitch is for look up and down, Roll is like you lean left and right, Yaw is what you need to rotate character.

Hey, i’m working on a small project where i’m trying to do so a third person character(from the template) can walk around on a floating sphere. But i’m having some problems making so that the character rotates so that it’s feet are towards the spheres location in the world so that it can actually walk on it.

I was thinking about doing it like this. This is in the spheres C++ class, it currently has a trigger sphere that it gathers all overlapping actors from and then find the actor that is the player.

ACharacter* Player = Cast<ACharacter>(OverlappingActors[i]);
FVector PlayerActorLoc = Player->GetActorLocation();
FVector Direction = GetActorLocation() - PlayerActorLoc;
FRotator PlayerRot = Direction.Rotation();
Player->SetActorRotation(FRotator(PlayerRot.Roll, PlayerRot.Pitch, PlayerRot.Yaw));

This does not currently work as the character just spins weirdly. I also understand that i don’t really want the player to rotate to the sphere as this will cause the character to faceplant the sphere as forward is not where it’s feet are.

Anyone have any idea how i can do so the player always keeps it’s feet towards the sphere?

I don’t really understand what you mean. Do you mean like this?

Player->SetActorRotation(FRotator(0.0f, 0.0f, PlayerRot.Yaw));

Because this just cause the character to spin around what looks like randomly.
I did also try

Player->SetActorRotation(FRotator(90.0f, PlayerRot.Yaw, 0.0f));

Which almost results in what i want but only works for the sides of the sphere (if you are looking at it from top down). If you go under or over it wont face the sphere middle anymore.

Sweet, that got it working! Thanks!
Here is the code if anyone needs it.

ACharacter* Player = Cast<ACharacter>(OverlappingActors[i]);
FVector PlayerActorLoc = Player->GetActorLocation();

FVector Direction = PlayerActorLoc - GetActorLocation();
FRotator PlayerRot = FRotationMatrix::MakeFromZ(Direction).Rotator();

oh ok, sorry, didn’t see all your question there. ^^ so basically your character Upward Vector must be same with the PlayerActorLoc - GetActorLocation(), so you can do this.

FVector Direction = PlayerActorLoc - GetActorLocation()
FRotator Rot = FRotationMatrix::MakeFromZ(Direction ).Rotator();

If not correct try reverse direction.