# Access Joints of Character in C++

**URL:** <https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530>\
**Category:** Character & Animation\
**Tags:** joints, unreal-engine, question, CPP\
**Created:** [April 13, 2018, 1:27pm UTC](https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530 "2018-04-13T13:27:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_41e411801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41e411801](https://forums.unrealengine.com/u/anonymous_user_41e411801)\
**Post date:** [April 13, 2018, 1:27pm UTC](https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530/1 "2018-04-13T13:27:45Z")

</div>

I am using the ThirdPerson Template. I want in C++ to access the Joints of the Skeletal Mesh of this character.

I found this Function in SkeletalMeshComponentPhysics.cpp

```
FName USkeletalMeshComponent::FindConstraintBoneName( int32 ConstraintIndex )
{
   UPhysicsAsset * const PhysicsAsset = GetPhysicsAsset();
   return PhysicsAsset ? PhysicsAsset->FindConstraintBoneName(ConstraintIndex) : NAME_None;
}

```

I am really a total beginner in C++ and UE4, so please excuse if the question sounds dumb, but how do I implement this code in my Character.cpp. If someone could show me a short example , I would be really grateful.

---

<div class="post-metadata">

**Author:** ![Arty-McLabin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arty-mclabin/32/1012076_2.png) [@Arty-McLabin](https://forums.unrealengine.com/u/Arty-McLabin)\
**Post date:** [April 13, 2018, 1:32pm UTC](https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530/2 "2018-04-13T13:32:40Z")

</div>

Do you possibly mean skeleton bones instead? you can access their transform this way:  
mesh-\>GetSocketTransform();

Also works for rotation, location, scale.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41e411801](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41e411801](https://forums.unrealengine.com/u/anonymous_user_41e411801)\
**Post date:** [April 16, 2018, 8:04am UTC](https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530/3 "2018-04-16T08:04:20Z")

</div>

Sockets are different to Joints . I want to be able to change the Joints angles of the Character, in order to move the bones

---

<div class="post-metadata">

**Author:** ![GigasightMedia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigasightMedia](https://forums.unrealengine.com/u/GigasightMedia)\
**Post date:** [April 19, 2018, 8:35am UTC](https://forums.unrealengine.com/t/access-joints-of-character-in-c/422530/4 "2018-04-19T08:35:31Z")

</div>

There are no such things as joints. Skeletons are made of Bones.

In order to directly manipulate the location or rotation of individual bones, you need to use a UPoseableMesh, rather than a USkeletalMesh. USkeletalMesh bone transforms can only be set by applying an existing animation.

See:

1. [UPoseableMeshComponent](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPoseableMeshComponent/index.html)
2. [UPoseableMeshComponent::GetBoneLocationByName](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPoseableMeshComponent/GetBoneLocationByName/index.html)
3. [UPoseableMeshComponent::GetBoneRotationByName](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPoseableMeshComponent/GetBoneRotationByName/index.html)
4. [UPoseableMeshComponent::SetBoneLocationByName](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPoseableMeshComponent/SetBoneLocationByName/index.html)
5. [UPoseableMeshComponent::SetBoneRotationByName](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/UPoseableMeshComponent/SetBoneRotationByName/index.html)
6. [EBoneSpaces](http://api.unrealengine.com/INT/API/Runtime/Engine/Components/EBoneSpaces__Type/index.html) - “EBoneSpaces” is an enum indicating if you are setting the location/rotation is WorldSpace or in the Bone’s local ComponentSpace. You set pass the proper value entering the ENumName::ValueName, e.g. “EBonesSpaces::ComponentSpace”

You may find some more help here:

[“How can I rotate Bones purely in C++?”](https://answers.unrealengine.com/questions/49667/question-rotating-bones-purely-in-c.html)
