Studio: ecs.ScaleAnimation.set(..) not working when a Collider is attached to the entity

Hi everyone,

In Studio, I need to play a scale animation at a certain point in my experience on an entity that also has a GLTF model attached to it. It was working fine until I added a Collider component to this entity.

β€’ Without a collider attached to my entity, I can trigger a scale animation using ecs.ScaleAnimation.set(…) in my code when needed.

β€’ With a collider attached, if I try to call ecs.ScaleAnimation.set(…), the GLTF model does not scale up.

Here I created a very basic code to reproduce the issue in a smaller experience:


If you perform the same test using an event listener either from a button click event or by calling world.events.dispatch(...),you get the same result: with a Collider component, the scale animation never scales up my model.

Although even with a Collider attached to the entity, if in your custom component you immediately call ecs.ScaleAnimation(..) in the add: () => function the scale animation will be working. But from the moment you play the animation inside a callback, delay it, it won’t scales up the model.

Is this a bug or not? How can I delay a scale-up animation to be played only when I need it? Let me know if you need more details or something is unclear in what I shared.

Thank you

I’m still not entirely sure why I have this issue, but I found a workaround for my situation. I’m sharing it in case someone else is facing the same problem:

When setting the Scale Animation, I add a timeout right after, with a duration that matches my animation time plus an extra delay (X). This ensures that the Collider is added by code after the animation finishes, instead of having it directly on the entity in Studio. It looks like this:

ecs.ScaleAnimation(.... ,{
...
duration: 800,
})

setTimeout(() => {
  ecs.Collider.set(world, eid, {
    shape: ecs.ColliderShape.Capsule,
    radius: 1,
    height: 5,
  })
}, 1000)

Now the collider is working and the Model has been scaled up as expected.