Hi everyone, I am implementing interaction with the enemy but after death animation is played, it is returning TPose instead of staying on ground. How do I stop the animation after it is finished?
I think its because you play animation once, and then there is nothing more to play, you can try to use cursor and set it at 0.99 to keep it on last frame? API reference (Model)
This feels like a bug/oversight on our part. I would expect the animation to stay on the last “frame” instead of going back to the default animation. This is how a sprite behaves when you have a default animation set on the sprite component and then play another animation once. The animation you played once stays on the last frame.
Do you have a separate “dead” animation with the enemy lying on the ground that you can transition to after the “dying” animation?
I don’t have one unfortunately. Do you think this would work?:
or should I find a way to hide the problem?
Also, I am using
msg.post("Skeleton#collisionobject", "disable")
to make it fall through level so it will be gone before t pose is played but it does not seem like disabling the collision shape is working
Can’t you make one in Blender? Duplicate the existing dying animation and cut away everything but the last keyframe and then play that looped.
Yes
I think you are right, it makes more sense to keep last frame than go to default.
And maybe its something to think about also:
- Cursor is great for fine-control on lowest level.
- You can start animation with play animation
- But would be nice to be able to set animation without starting
- Get name of current animation.
- And stop animation (freeze)? I don’t think we have it yet? Otherwise you need to loop though the cursor and set it every time?
In my mind at least it compliments cursor quite well, as user can decide themself how to play it. And opens future possibilities to blend between animations?
it makes more sense to keep last frame than go to default
I’ve created a ticket on GH: Model animations played once return to the default animation when completed · Issue #11470 · defold/defold · GitHub
Is this sprite or spine animation?
I am using 3d models and for animating I use model.play_animation. Probably neither of them unless 3D animations are considered Spine animation (Maybe bone animation? Not sure about the naming)
Probably neither of them unless 3D animations are considered Spine animation
It’s model animations. We only support baked bone animations with matrices
for each animated bone each keyframe.