# Hand bone (IK) rotation to surface

**URL:** <https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299>\
**Category:** Character & Animation\
**Tags:** unreal-engine, bone-rotation, question\
**Created:** [August 1, 2015, 3:19pm UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299 "2015-08-01T15:19:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PersnicketyGareth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PersnicketyGareth](https://forums.unrealengine.com/u/PersnicketyGareth)\
**Post date:** [August 1, 2015, 3:19pm UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/1 "2015-08-01T15:19:36Z")

</div>

I started a forum post about this but I haven’t received any responses, thought I’d try to boost exposure to the issue using this place.

[Link to forum post](https://forums.unrealengine.com/showthread.php?78715) (It just reads the same as below).

* * *

I am trying to make a character put their hands on a nearby surface.

I have done the IK, so the hand actually moves to the surface. I also have the surface normal vector of the surface at the point where I want the hand to be going to.

How do I convert this surface normal into the correct Rotator for the hand?

I tried using RotationFromXVector, Rotation from X, Y and Z. None of them will line up to make the palm face the surface.

Any help appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![PersnicketyGareth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PersnicketyGareth](https://forums.unrealengine.com/u/PersnicketyGareth)\
**Post date:** [August 1, 2015, 5:52pm UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/2 "2015-08-01T17:52:41Z")

</div>

Update!

Managed to get the angle I want using “Make Rot from XY” by putting the surface normal into the Y axis, and setting the X-axis as default.  
I wish these “make rot from XY” functions were available in C++. If anyone knows how to get them, let me know.

---

<div class="post-metadata">

**Author:** ![PersnicketyGareth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PersnicketyGareth](https://forums.unrealengine.com/u/PersnicketyGareth)\
**Post date:** [August 1, 2015, 11:54pm UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/3 "2015-08-01T23:54:44Z")

</div>

Update 2!

Found the C++ functions.

> **[FRotationMatrix](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Core/Math/FRotationMatrix/)**
>
> Rotation matrix no translation

---

<div class="post-metadata">

**Author:** ![alliways](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alliways](https://forums.unrealengine.com/u/alliways)\
**Post date:** [February 6, 2016, 10:06pm UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/4 "2016-02-06T22:06:04Z")

</div>

Do you have a tutorial on this??? I’ve looked at the 3 screenshots. (I’m an animator, so blueprints aren’t my specialty, hehe).

---

<div class="post-metadata">

**Author:** ![SlimeQ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SlimeQ](https://forums.unrealengine.com/u/SlimeQ)\
**Post date:** [October 26, 2016, 1:12am UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/5 "2016-10-26T01:12:33Z")

</div>

you’ll need to include the Kismet Math library.

```
#include "KismetMathLibrary.h"

```

then

```
FRotator RotFromXY = UKismetMathLibrary::MakeRotFromXY(X, Y);

```

This library contains all of the rotator functions you’re used to using in blueprint.

---

<div class="post-metadata">

**Author:** ![CtnDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ctndev/32/1133321_2.png) [@CtnDev](https://forums.unrealengine.com/u/CtnDev)\
**Post date:** [September 2, 2023, 10:49am UTC](https://forums.unrealengine.com/t/hand-bone-ik-rotation-to-surface/327299/6 "2023-09-02T10:49:09Z")

</div>

Why not using default constructor of FRotator in C++ ?
