Replies: 2 comments
-
You may ensure that a special
I don't think I understand well. Why beforehand? You could spawn the splash animation when you need it. When it comes to differentiating shot animation from other entities, it's the same as how to differentiate any entity. You may use a "tag" component to recognize the purpose of the entity. Lastly, be aware that you can also reset the animation by calling Personally, I think I would go the route of spawning a new "splash" animation entity, and despawn it when it is done by detecting when the fn despawn_splashes(mut cmds: Commands, splashes: Query<(), With<Splash>>, ended: RemovedComponent<Play>) {
for entity in ended.iter().filter(|e| splashes.get(e).is_ok()) {
cmds.entity(entity).despawn();
}
} |
Beta Was this translation helpful? Give feedback.
-
I mean to add all animation entities when the parent entity is created (Player may have multiple animations - shot, engine fire, and some effects) but without Adding tag components to select the exact animation amongst others, would definitely work for me. Thanks. |
Beta Was this translation helpful? Give feedback.
-
How can I have animation to run once on demand? I need to show shot splash animation each time player does a shot. I see 2 options here:
visibility: Visibility{is_visible: false},
. And then on each shoot to addPlay
component in it and set up visibility to true. The problem here is how do I differ shot animation entity from other animation entities?Beta Was this translation helpful? Give feedback.
All reactions