I’m currently creating a movement script for pawn where the rotation is Slerped based on what keys are pressed and the rotation of the camera, as well as the normal of a slope. However the angle is set on world, even though i use SetActorRelativeRotation. This causes the rotation to work not as intended and the angle pivots on the worlds upward vector, and not the actor’s.
Not sure, but I think you’re confusing relative transform and local transform. “Relative” is relative to whatever the actor is attached to (or the world if the actor is not attached to anything). “Local” is relative to the actor’s current transform.
As dbouchoff statet, RelativeRotation is always relative to the parent. And if your Actor is not attached to something, it is always relativ to the World, therfore it is in world space.
Edit, if you are looking for the c++ implementation of it, you can right-click the BP node and goto the c++ implementation.
AddActorLocalRotation sets the rotation with respect to the current rotation. But note that if you do it twice, the rotation the second time is with respect to where the actor was after the first part of the rotation. Assuming newRotation is the eventual rotation you want in local space, I think what you mean to do is to first compute the final rotation (use ComposeRotators(GetActorRotation(), newRotation)) and then slerp between the actor’s starting rotation and that rotation.