# Rotating component on Z axis?

**URL:** <https://forums.unrealengine.com/t/rotating-component-on-z-axis/1644446>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [January 26, 2024, 6:48pm UTC](https://forums.unrealengine.com/t/rotating-component-on-z-axis/1644446 "2024-01-26T18:48:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [January 26, 2024, 8:36pm UTC](https://forums.unrealengine.com/t/rotating-component-on-z-axis/1644446/3 "2024-01-26T20:36:24Z")

</div>

Thank you for take your time to help me.  
I will try your solution.  
And I researched some other topics.  
And they described very well.  
I think it’s my lack of base knowledge causing the issue.

> [@Set local rotation](https://forums.unrealengine.com/t/set-local-rotation/391658/2):
>
> local space rotations are for components that are attached to other components. if you want to rotate an actor around its up vector, you can use RotatorFromAxisAndAngle. and if you want to set the rotation, instead of adding to it, just skip the getActorRotation/CombineRotators part.

> [@what is the difference between "Add Relative Rotation" and "Add Local Rotation"](https://forums.unrealengine.com/t/what-is-the-difference-between-add-relative-rotation-and-add-local-rotation/1244791/6):
>
> 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 a…

---

_[View the full topic](https://forums.unrealengine.com/t/rotating-component-on-z-axis/1644446)._
