Description
bevy version: main commit dff071c
What you did
I tried to play a Handle<AnimationClip>
which animates X (using entity path) on a AnimationPlayer
component of entity Y, and the animation played.
What went wrong
The animation played, when the given animation is not supposed to work with this entity. the issue lies in
bevy/crates/bevy_animation/src/lib.rs
Lines 273 to 284 in d623731
The name of the root entity is entirely dismissed.
I have three different animated meshes, each with their own AnimationPlayer
component.
I have a collection of Handle<AnimationClip>
, each AnimationClip
is relevant to a single of three meshes (AnimationClip
even contains a path to the animated entities).
I can call AnimationPlayer::play
on component of entity 1, with an Handle<AnimationClip>
containing an animation for entity 2.
This is wrong, it should be impossible to do that.
Ideal implementation
It is possible to check for compatibility in find_bone
, return None
and print a warning, but ideally, the AnimationPlayer::play
method should be able to fail if given the wrong Handle<AnimationClip>
, and users should be given a way to test for animation compatibility. This way, it's actually possible to do something about it.
Additional information
This was found it because using the wrong animation on the wrong entity causes a panic with morph targets.