# Rotation Animation Not working

**URL:** <https://forum.8thwall.com/t/rotation-animation-not-working/8133>\
**Category:** Technical Support\
**Created:** [August 20, 2025, 12:08pm UTC](https://forum.8thwall.com/t/rotation-animation-not-working/8133 "2025-08-20T12:08:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaksha\_Visual\_Techno](https://avatars.discourse-cdn.com/v4/letter/y/c4cdca/32.png) [@Yaksha\_Visual\_Techno](https://forum.8thwall.com/u/Yaksha_Visual_Techno)\
**Post date:** [August 20, 2025, 12:08pm UTC](https://forum.8thwall.com/t/rotation-animation-not-working/8133/1 "2025-08-20T12:08:34Z")

</div>

After Instantiate I plan to Rotate Animation

if (prefabToSpawn && hasPlaced === 0) {

```
      const {worldPosition} = e.data as any

      const newInstance = world.createEntity(prefabToSpawn)

      const randomScale = Math.random() \* (maxScale - minScale) + minScale

      ecs.Position.set(world, newInstance, worldPosition)

      ecs.ScaleAnimation.set(world, newInstance, {

        fromX: 0,

        fromY: 0,

        fromZ: 0,

        toX: randomScale,

        toY: randomScale,

        toZ: randomScale,

        duration: 400,

        loop: false,

        easeOut: true,

        easingFunction: 'Quadratic',

      })

      **ecs.RotateAnimation.set(world, newInstance, {**

        **fromX: 0,**

        **fromY: 0,**

        **fromZ: 0,**

        **toX: 0,**

        **toY: 360, *// spin around Y axis***

        **toZ: 0,**

        **duration: 2000,**

        **loop: true, *// 🔁 keep spinning***

        **easeOut: false,**

        **easingFunction: 'Linear', *// smooth constant spin***

      **})

```

this is script i can use So Rotation not working\*\*

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [August 20, 2025, 6:38pm UTC](https://forum.8thwall.com/t/rotation-animation-not-working/8133/2 "2025-08-20T18:38:55Z")

</div>

Hi, welcome to the forum!

The reason it’s “not working” is because by default the rotationAnimation will choose the shortest path to reach the target. In this case the shortest path to a full rotation is to not actually move at all.

The solution to this is to add `shortestPath: false` to your component schema. 🙂

> **[RotateAnimation | 8th Wall](https://www.8thwall.com/docs/api/studio/ecs/animation/rotate-animation/)**
>
> Description
