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**