# Set point-to-point rotation

**URL:** <https://forum.babylonjs.com/t/set-point-to-point-rotation/35782>\
**Category:** Questions\
**Created:** [November 17, 2022, 2:56pm UTC](https://forum.babylonjs.com/t/set-point-to-point-rotation/35782 "2022-11-17T14:56:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![farukcelim](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/farukcelim/32/27134_2.png) [@farukcelim](https://forum.babylonjs.com/u/farukcelim)\
**Post date:** [November 17, 2022, 2:56pm UTC](https://forum.babylonjs.com/t/set-point-to-point-rotation/35782/1 "2022-11-17T14:56:56Z")

</div>

Hi, in summary I am trying to find the rotation between two points. The little bears in the picture should turn towards the big bear. For this I just need to rotate the y rotation, but the question is, with what calculation can I find the correct y value? Please your help.

> **[Babylon.js Playground](https://playground.babylonjs.com/#2KRNG9%231226)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/2/02aa5f3f59fa8fc2a078451941800f196d43a6c1.jpeg)

This code is supposed to be working

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/d/c/dc754f98d8d5f1d9e7a67c5ab8d9f16757ab39e4.png)

---

<div class="post-metadata">

**Author:** ![flex](https://avatars.discourse-cdn.com/v4/letter/f/8baadc/32.png) [@flex](https://forum.babylonjs.com/u/flex)\
**Post date:** [November 17, 2022, 5:26pm UTC](https://forum.babylonjs.com/t/set-point-to-point-rotation/35782/2 "2022-11-17T17:26:57Z")

</div>

Use mesh.lookAt

> **[Mesh | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Mesh-1#lookAt)**
>
> Class used to represent renderable models \[API\]

> **[Babylon.js Playground](https://playground.babylonjs.com/#2KRNG9%231228)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

This applies the rotation to rotationQuaternion on the mesh and there is only a y component so no need to flatten the little guy’s feet.
