Skip to content

Conversation

@spookyvision
Copy link

Objective

  • fix 2d examples not compiling, error was:
$ cargo run --example $ANY_AVIAN2D_EXAMPLE
error[E0433]: failed to resolve: use of undeclared type `Animatable`
   --> crates/avian2d/../../src/diagnostics/ui.rs:434:24
    |
434 |         text_color.0 = Animatable::interpolate(&green, &red, t.min(1.0)).into();
    |                        ^^^^^^^^^^ use of undeclared type `Animatable`

Solution

  • add bevy_animation to bevy feature flags in examples_common_2d

@Jondolf Jondolf added C-Examples Improvements or additions to examples 2D Specific to two dimensions P-Compile-Failure A failure to compile Avian labels Mar 22, 2025
@Jondolf Jondolf mentioned this pull request Apr 26, 2025
@Jondolf
Copy link
Member

Jondolf commented Apr 26, 2025

Hi, thanks and sorry for getting to this so late!

There's still a few issues here: I believe this only fixes the problem for the 2D examples, not 3D or for Avian itself. If someone was using Avian without having bevy_animation enabled for Bevy, they could get the same problem.

I've fixed this in #711 by just getting rid of the use of Animatable altogether.

@Jondolf Jondolf closed this Apr 26, 2025
Jondolf added a commit that referenced this pull request Apr 26, 2025
# Objective

Fixes #708.
Alternative to #674 and #710.

#710 updates Avian to Bevy 0.16, but doesn't update the README. Both #674 and #710 also fix an error about missing `bevy_animation` by enabling the `animation` feature (only in 2D, so 3D is still broken) rather than removing the root problem, the unnecessary use of `Animatable` in `src/diagnostics/ui.rs`.

## Solution

Update to Bevy 0.16 and replace the use of `Animatable` with manual interpolation code.
@spookyvision
Copy link
Author

I think the reason I specifically fixed this only for 2D was that the 3D examples were building fine (probably because they didn't use that UI overlay), but I guess I was missing the forest for the trees here 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2D Specific to two dimensions C-Examples Improvements or additions to examples P-Compile-Failure A failure to compile Avian

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants