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
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.
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
Most of my confusion was due to the use of Relative Rotation, which I assumed would be LOCAL. but is infact not.
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