# How to rotate a bone about a certain axis in C++

**URL:** <https://forums.unrealengine.com/t/how-to-rotate-a-bone-about-a-certain-axis-in-c/428645>\
**Category:** Character & Animation\
**Tags:** skeletalmeshcomponen, unreal-engine, UE4, CPP, question\
**Created:** [July 3, 2018, 9:35pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-bone-about-a-certain-axis-in-c/428645 "2018-07-03T21:35:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fc2539f0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fc2539f0](https://forums.unrealengine.com/u/anonymous_user_fc2539f0)\
**Post date:** [July 3, 2018, 9:35pm UTC](https://forums.unrealengine.com/t/how-to-rotate-a-bone-about-a-certain-axis-in-c/428645/1 "2018-07-03T21:35:24Z")

</div>

I am rotating bones using C++ code and an animation blueprint that uses custom variables. I want to be able to write as the functionality of those custom variables a rotation about a specific axis (z).

 ![246111-customvar.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/c/78c1c6d289bd765a66a6212d075935a489119dee.png)

This is how I am using these variables now, though they don’t really have any functionality because I just copied this from a tutorial. So given this (this is my actor class cpp), how can I define these variables to rotate around a specific axis?

Thank you for your time.
