what is the difference between "Add Relative Rotation" and "Add Local Rotation"

what is the difference between them?
rotating a cube using the "Add Relative Rotation"function is no different from rotating a cube using “Add Local Rotation”.

Add local, just adds some more rotation to the rotation it already has, regardless of anything else.

Add relative, adds a certain amount of rotation, with respect to the parent of the object or component.

If you’re applying it to a standalone actor, then it won’t mean anything. It has a lot more relevance when you’re applying the rotation to a component, for example.

can you show at least one example so that “Add Relative Rotation” differs from “Add Local Rotation”
no matter what I do they give the same result

1 Like

I watched this video. it calls different functions and gets the same result.
I didn’t understand anything from this video. I can’t find an example where “Add Relative Rotation” differs from “Add Local Rotation”

Have this BP with a cylinder component, which has relative rotation X = 20
So the cylinder is rotated 20 degrees around X (red) axis from the parent reference frame.
image

The reference frame (gizmo) shown above is the relative (parent’s) reference frame.

If I add a relative Z rotation to cylinder, it’s gonna rotate around that blue axis :


aaaaaa


Now this is the cylinder’s local reference frame :

image

If I add the same Z rotation as a local rotation, it’s gonna rotate around cylinder’s blue axis, which results in this :


bbbb

4 Likes

Thank you. this is a very good example. This is a good example.

I repeated your lesson and now “Add Relative Rotation” does the same thing as “add world rotation”;
Is it possible to make them different?

Relative and Absolute are the same in this case, because the parent of the cylinder is the root component of the actor, and I did not rotate the actor in the scene.

My bad, I should have thought about this.
So here I added X=90° to the placed actor in scene, now the actor is horizontal by default :

image

AddLocalRotation rotates around the cylinder’s local Z axis

ccc

AddRelativeRotation rotates around the cylinder parent’s local Z axis (= root component in this case)

bbb

AddAbsoluteRotation rotates around the world’s Z axis

aaa

7 Likes

thank you good man. I tried for a very long time to understand how it works. I watched other videos but didn’t understand anything. Thanks for spending your time on these examples. Without them I would never have understood.

Hi, thanks for explain, but when I set the box as a child of cone, and addRelativeRotation 1,0,0 every frame, it rotation like addLocalRotation, I expect it to orbit around the x-axis of the cone, Did I misunderstand anything?
UnrealEditor_QnP9m6ERVo

Nah, rotation is applied after translation, so these functions will never make the target object orbit. If you rotate the cube, it will rotate the cube around its own pivot point, even if you’re using axis of the cone’s reference frame.

If that was not the case, using AddAbsoluteRotation would make all objects orbit around the World origin.

Applying rotation to the cone would make the cube orbit, since the cube has a relative translation from the cone.

Why “rotation is applied after translation, so these functions will never make the target object orbit.” ? Could you please provide a more detailed explanation?