Make parent rotation match child rotation

I have a character that has CapsuleComponent as root and couples of SkeletalMesh as my character mesh.
Now there is case that I’m using mouse input to rotateSkeletalMesh on Pitch and Yaw while this happens ActorRotation made to remain still, and after that process the SkeletalMesh has a wrong forward facing. also the skeletalMesh has -270 to 270 rotation while ActorRotation has -180 to 180, so when SkeletalMesh reached 180 it goes to 181 and so on while ActorRotation on 180 reached it goes to -180 to -179 and so on. idk if this matters or not i just pointing it out.

  • As the title says how can i match the Parent Actor Rotation to it’s child rotation while the child rotations remains the same?

I’m using MoveComponentTo() to move the whole actor, and in process the rotation is locked and i can’t rotate the whole actor, here i switch to SkeletalMesh rotation till the moving part is done, and that’s where i end up with wrong forward facing for the SkeletalMesh.

That would be a great help if some one could help me out, already spend a whole day on it.

Is there a reason why you cant rotate the actor instead of the skeletal mesh?

Yes, I’m using MoveComponentTo()

UKismetSystemLibrary::MoveComponentTo(GetCapsuleComponent(),
CharacterLoc, CharacterRot, false,
false, .2f, false,
EMoveComponentAction::Type::Move,
LatInfo);

and once I give the CharacterRotation, it just locks the actor rotation until the movement is done.
so with that i just switch the mouse input to add rotation to CharacterMesh instead of whole actor.

Bump, my game almost finished and this parts holds it back from releasing it, i did found FindLookAtRotation but idk how i should use it here. maybe there is similar function that does this?