Download

Combine rotator and delta (rotator)

Heyho,

I’m back again with questions on the subject of rotation (I wonder when I’ll get it :D)

  1. How the heck does Combine Rotators work? I don’t get it. It only gets the information of two rotators, no position, nothing and still the output never adds up for my taste. If rotator A is (60,170,270) and B is (20,190,-15) i would consider the combination of the A and B to be either A+B (80,360/0,255/-90) or A+B/2 (40,180/0,127.5/-45) but this never seems to be the case… Why?

  2. Same question for Delta (Rotator). I got the rotators A (64,-81,39) and B (64,161,-36) and the Delta node gave me (-2,0.06,117)…I know it somehow normalizes, but this still doesn’t work?

The combine rotators node gives different results depending on which way round you wire it up.

Never used delta rotation, I assume it’s a nightmare.

2 Likes

Hi, combine rotators does not simply add rotators together. It first applies A, then B. For example with no rotation your vector faces in the X-Axis.

If you now rotate it 90 degrees by yaw it will face in Y-Axis, then 90 degrees by pitch it will still face in Y-Axis, you just rolled the vector by 90 degrees (end result in 90 degree yaw and 90 degree roll).

If you first rotate 90 degrees by pitch, then now it is facing in Z-Axis. Then 90 degrees by Yaw and it will still face in Z-Axis you have again rolled it now by -90 degree, so end result is 90 degree pitch and -90 degree roll.

1 Like

TIP: Don’t try and write BP one node at a time. Instead scour the forums for mini-snippets to see how code comes together. Community-Tools has lots of mini-games. Seeing code in practice makes things a lot simpler.

To the question… A helpful example of using CombineRotators that you see a lot is using it as an input to RInterpTo, to smoothly rotate a camera (or whatever), so that it lines up nicely with a target actor (enemy).

FindLookAtRotation is still the best for most applications, but it won’t work when you don’t know 2 points in space, and the camera / target are both moving. In that case the Camera actor gets plugged into RInterpTo ‘Current’. And the target or enemy rotation gets passed to CombineRotators ‘Target’, with the B input something like [0,0,180] to flip the camera around so that it faces the enemy.

Delta (Rotator)… Again finding snippets in Community-Tools or even blueprintue.com will help. Delta (Rotator) gets used in AnimBP’s or anywhere direction calcs are important to align things (especially Yaw axis).

Hey,
thanks for the response! So what you are saying is that “combine Rotator” first applies the A rotation in x,y,z and after that the B rotation? Your example was good but it only concentrated on one rotator, doesn’t it?

It first applies rotation A, then rotation B.

Imagine you have something attached to a character (e. g. a weapon) and you have a vector in world space that you want to rotate into the weapon space. E. g. if the vector would point in (x=1, y=0, z=0) and you rotate it by CombineRotators A being character rotation, B being weapon rotation relative to character, this vector will now point in the forward direction of the weapon. You could ofc achieve the same result by just taking world rotation of the weapon and rotating the vector by that.

Or if you got a mesh that faces in Y direction (so has a rotation offset of -90 yaw, so with the actor having 0 rotation, the actors forward vector is in X-Axis, but the mesh points in Y-Axis). Now if you want that mesh to point at some location (e. g. FindLookAtRotation) and just use that rotation, your forward axis will face that direction. But since the mesh has an offset of -90 yaw to that forward axis, it will not face to that direction you want. To solve that you would use CombineRotators where you first apply that rotation offset, so -90 yaw and then the result of FindLookAtRotation.

So if you want to combine rotators, you cannot do that by adding or subtracting them, you need to use CombineRotators.