# Rotate hinge joint with angle

**URL:** <https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867>\
**Category:** Questions\
**Tags:** rotationaxis\
**Created:** [December 25, 2022, 10:15pm UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867 "2022-12-25T22:15:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliatwa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aliatwa/32/28956_2.png) [@aliatwa](https://forum.babylonjs.com/u/aliatwa)\
**Post date:** [December 25, 2022, 10:15pm UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867/1 "2022-12-25T22:15:04Z")

</div>

I’m trying to rotate the model objects with angles like robot arm, but arms doesn’t rotate in constraint to each other. I tried using HingeJoint but I think it does not support rotating with a specific angle [https://playground.babylonjs.com/#AV3J28#12](https://playground.babylonjs.com/#AV3J28#12)

![Structural-diagram-of-four-DoF-robot-ARM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/0/50a2e93a33176d4ebd3695c3e193eb9700c69ac5.png)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 26, 2022, 11:59am UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867/2 "2022-12-26T11:59:45Z")

</div>

Welcome aboard!

I never used physics engine before, so take what I’m saying with a big grain of salt!

cc @Cedric who knows much more about physics than me and who will be able to shed some light on what’s going on (but be patient as it is vacation time these days).

First you have some existing rotations on your meshes, I’m not sure it’s the easiest to work with, so I have removed them in my PG below. Also, it seems physics don’t work as expected with parented meshes, so I have removed the parents for arm1 and arm2.

Also, I think you should not update the rotation / position properties “by hand” but should apply impulses instead when working with physic objects.

So, here’s a PG that appears to work when rotating just the second arm:

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

I could not make it work when trying to add another joint and rotating arm1, though…

---

<div class="post-metadata">

**Author:** ![aliatwa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/aliatwa/32/28956_2.png) [@aliatwa](https://forum.babylonjs.com/u/aliatwa)\
**Post date:** [December 26, 2022, 3:33pm UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867/3 "2022-12-26T15:33:03Z")

</div>

I tried using some basic models and it is working just using child & parent  
[https://playground.babylonjs.com/#UFVU18#664](https://playground.babylonjs.com/#UFVU18#664)  
but I want try with glb file from blender. do you have idea how to export it correctly should should I make objects parent & child in blender or separate them??

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 26, 2022, 4:48pm UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867/4 "2022-12-26T16:48:03Z")

</div>

You are not using a physics engine in this PG.

If you want to use a physics engine, I think we’ll have to wait for @Cedric’s feedback as I’m not competent enough in this area.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [January 3, 2023, 11:00am UTC](https://forum.babylonjs.com/t/rotate-hinge-joint-with-angle/36867/5 "2023-01-03T11:00:26Z")

</div>

Did you try to use IK ? [Bones and Skeletons | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons#boneikcontroller)

I think it would match what you want to achieve: have something dynamic that you can play with while keeping it simple.
