bevyengine / bevyengine/bevy

Multiple `AnimationTarget` per entity

Open
#16,697 1 comment 0 reactions 0 assignees View on GitHub
A-Animation C-Feature S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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 `AnimationTarget`s 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.