Set Rotation Never Works as Relative/Local

Hi
Having a major problem with applying streaming LOCAL rotation data to an Actor.

Set Relative Rotation always applies the data as World.
Set Rotation also always applies the data as World.
Set Transform the same etc.

How is it possible to actually apply LOCAL rotation data to an object??

Our test case:

Start actor at P:0,Y:0,R:0 (Pitch yaw roll)
turn actor P: 45 moves actor up pitch 45
back to 0,0,0
then yaw 90, actor turns yaw 90
then (LOCAL PITCH) pitch the object 45 and actor ROLLS 45

HELP please!

Hi ,

I was confused by this myself when I first started using UE4 but if you’re working in blueprints, you can use the AddActorLocalOffset for transform, but there isn’t any node that I can think of to do rotation at the moment. As I feel like this should be a node as well, or that AddActorLocalOffset should include rotation, I’ve placed a feature request in to have this added. There is no guarantee that it’ll be added in a future update, but it is possible.

In the meantime, you could use a combination of the Get Relative Rotation, Break Vector, Make Vector, and Set Relative Rotation nodes to workaround this.

I hope we can get this feature added for you.

Hi ,

Thanks for the info. Did some investigation here and this seemed to work:
Comparing the current rotation with the previous rotation sample, making sure the data is normalized (0 to 360, not -180 to -180)
Then apply this using Add Actor Local Rotation.

This is make a bit frustrating because I can’t use a get actor local rotation. Perhaps a get/set for LOCAL rotation would be nice update in the future :slight_smile:

Most of my confusion was due to the use of Relative Rotation, which I assumed would be LOCAL. but is infact not.

whilst my answer above does solve the issue, if there is any errors in the data there is no way to verify it at without a get actors local rotation :frowning:

This is what I would use to do relative rotation, as a workaround for now.

It’s very basic, but it may get you where you need to be

Is this to obtain the difference between the actors rotation and the center of the world?

The 2nd node in the sequence (Get Relative Rotation) would be returning the value that is in the rotation of the target (The root component of the Actor in my case) and using that for the calculation every tick. This particular blueprint would cause the cube to rotate in place using the Yaw, 1 degree per tick.

Edit: Or I was using subtraction at the time of the screenshot, so -1 degree per tick :slight_smile:

wow, ok I managed to solve it a different way that I wouldn’t have expect to work.
Am setting the world rotation to 0,0,0 at the start of each frame.

I would have expected this to pop constantly back to the origin (being usable) but rather its unnoticeable. this solves the accumulation of errors.