Skip to content

Multiple AnimationTarget per entity #16697

Open
@musjj

Description

@musjj

What problem does this solve or what need does it fill?

Currently, an entity can only have a single AnimationTarget because it needs to be inserted directly into the entity. This reduces flexibility when you want to have multiple, decoupled animations per entity. For example, an entity can have an idle animation playing by default. And when the entity gets attacked, you want to insert another animation that tweens the entity's color so that it flashes red.

What solution would you like?

Allow AnimationTarget to be a child of the target entity. This allows an entity to have multiple AnimationTargets as children.

What alternative(s) have you considered?

I don't think there's a way to work around this limitation with the built-in animation system.

Additional context

The approach taken by https://github.com/Multirious/bevy_tween is that animators can be the child of the target entity. The animator will traverse up the hierarchy to find the target entity. This means than an entity can have multiple active animations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnimationMake things move and change over timeC-FeatureA new feature, making something new possibleS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions