# Rotate objects with axis using keys

**URL:** <https://forum.babylonjs.com/t/rotate-objects-with-axis-using-keys/38854>\
**Category:** Questions\
**Created:** [March 8, 2023, 3:09pm UTC](https://forum.babylonjs.com/t/rotate-objects-with-axis-using-keys/38854 "2023-03-08T15:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ancherly](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ancherly/32/30502_2.png) [@ancherly](https://forum.babylonjs.com/u/ancherly)\
**Post date:** [March 8, 2023, 3:09pm UTC](https://forum.babylonjs.com/t/rotate-objects-with-axis-using-keys/38854/1 "2023-03-08T15:09:42Z")

</div>

Good afternoon, investigating a little I have achieved that through an array of objects to generate a circle and rotate about the center of the circle created.  
Instead of rotating with animation I want to rotate to the next object by pressing a key and stay in the position where the reference line is placed.

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

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 8, 2023, 5:45pm UTC](https://forum.babylonjs.com/t/rotate-objects-with-axis-using-keys/38854/2 "2023-03-08T17:45:22Z")

</div>

Good afternoon,

Instead of running rotate every frame, you can simply animate the desired value for the y rotation property of each sphere: [Introduction to Animations | Babylon.js Documentation (babylonjs.com)](https://doc.babylonjs.com/features/featuresDeepDive/animation/animation_introduction)

---

<div class="post-metadata">

**Author:** ![ancherly](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ancherly/32/30502_2.png) [@ancherly](https://forum.babylonjs.com/u/ancherly)\
**Post date:** [March 9, 2023, 6:54pm UTC](https://forum.babylonjs.com/t/rotate-objects-with-axis-using-keys/38854/3 "2023-03-09T18:54:09Z")

</div>

After researching the documentation I have managed to get it to work! Thank you very much!
