I have a spotlight that I want to rotate towards a direction, using only one axis of rotation for each of the two moving components. The base doesn’t move at all.
Here’s a screenshot of the swivel portion. It should only rotate along the axis shown. (Just happens to be roll)
I can make the head rotate correctly just fine using just SetWorldRotation, but this is not ideal since it isn’t constraining the head to only the pitch, and its not rotating the swivel at all obviously.
If you have more than 1 component for each of the parts of your object, you can set different types of rotation to each of the components.
Remember that pure nodes are executed each time a value is asked of them, so I would suggest storing the rotation in a variable so you can use it to set the rotation to the next component as well (pitch, roll)
I hope that’s what you were trying to do
Also beware of gimbal locks, although I don’t expect you to run into that
You can right click on the rotator variable and break it into 3 floats for each rotation axis.
As for why it doesn’t work with relative rotation - it doesn’t because you change the forward vector of the component if it’s attached to something else which rotates. So the rotation doesn’t match anymore. You can add the rotation of whatever this is attached to the formula and it should work.
in the second set relative rotation node you’re setting yaw to roll instead of yaw to yaw (if that makes any sense), I used roll as you used roll in your OP