# Local bone rotation

**URL:** <https://forums.unrealengine.com/t/local-bone-rotation/339410>\
**Category:** Character & Animation\
**Tags:** unreal-engine, bone-rotation, question, CPP\
**Created:** [November 23, 2015, 9:36am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410 "2015-11-23T09:36:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DivideByZero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DivideByZero](https://forums.unrealengine.com/u/DivideByZero)\
**Post date:** [November 23, 2015, 9:36am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/1 "2015-11-23T09:36:03Z")

</div>

I can’t seem to get the local/relative bone rotation during an animation

I tried:

```
FTransform parent = Mesh->GetBoneTransform(parentIndex);
FTransform child = Mesh->GetBoneTransform(childIndex);
FTransform localA = child * parent.Inverse();
FTransform localB = child.GetRelativeTransform(parent); // same as localA
FRotator rot = localA.Rotator();
Mesh->TransformToBoneSpace(...) // also didn't work

```

I’m testing a skeleton that only animates the chest. The parent bone is the upper arm and the child bone is the lower arm.  
When I try to get the local rotation the values look more like global rotations.

Setting the rotation seems fine: [Finding bone-local transforms - Character & Animation - Unreal Engine Forums](https://answers.unrealengine.com/questions/299837/finding-bone-local-transforms.html)  
I don’t think I can use this method to find the local rotation. It looks like it just finds the component space reference pose and sets the rotation.

---

<div class="post-metadata">

**Author:** ![rantrod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rantrod](https://forums.unrealengine.com/u/rantrod)\
**Post date:** [November 24, 2015, 3:20am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/2 "2015-11-24T03:20:55Z")

</div>

USkinnedMeshComponent \*Mesh = Cast(GetMesh());  
if (Mesh)  
{  
FQuat TestQ = Mesh-\>GetBoneQuaternion(TEXT(“lowerArm”), EBoneSpaces::WorldSpace);  
FQuat TestQ2 = Mesh-\>GetBoneQuaternion(TEXT(“upperArm”), EBoneSpaces::WorldSpace);  
FQuat local = TestQ2.Inverse() \* TestQ;  
}

There used to be a local bone space but it was removed for some reason.

---

<div class="post-metadata">

**Author:** ![DivideByZero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DivideByZero](https://forums.unrealengine.com/u/DivideByZero)\
**Post date:** [November 24, 2015, 6:25am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/3 "2015-11-24T06:25:49Z")

</div>

Exactly what I was looking for, thanks.

---

<div class="post-metadata">

**Author:** ![MaximeDupart](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maximedupart/32/1194606_2.png) [@MaximeDupart](https://forums.unrealengine.com/u/MaximeDupart)\
**Post date:** [August 27, 2017, 4:32am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/4 "2017-08-27T04:32:38Z")

</div>

Hello savior from the past. We’re mid-2017 and tonight you’re my hero. 😃

---

<div class="post-metadata">

**Author:** ![KEATE\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KEATE\_1](https://forums.unrealengine.com/u/KEATE_1)\
**Post date:** [July 24, 2019, 2:40am UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/5 "2019-07-24T02:40:11Z")

</div>

Is there any way to set bone local rotation in blueprint?

---

<div class="post-metadata">

**Author:** ![LasorMan1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LasorMan1](https://forums.unrealengine.com/u/LasorMan1)\
**Post date:** [July 18, 2024, 3:06pm UTC](https://forums.unrealengine.com/t/local-bone-rotation/339410/6 "2024-07-18T15:06:15Z")

</div>

THIS! I need to know if there is a good way to retrieve the local-space FRotator of a bone so I can detect animations regardless of where the character is facing in world space.
