Blender_bevy_components_workflow icon indicating copy to clipboard operation
Blender_bevy_components_workflow copied to clipboard

is there a way to customize animation speed per entity

Open olekspickle opened this issue 9 months ago • 1 comments

Thank you for this amazing crate!

basically the title. For example I have two models and want to speed up or slow down depending on the entity I query

With a bit of guidance I'm interested in doing a PR with this

olekspickle avatar Jan 30 '25 16:01 olekspickle

ok, I found a way but it's weird. I think user friendlier options mimicking bevy players style should be nice:

// instead of
... 
let Some((&playing_animation_index, _)) = animation_player.playing_animations().next()
else {
    continue;
};
let playing_animation = animation_player
    .animation_mut(playing_animation_index)
    .unwrap();
let speed = playing_animation.speed();
playing_animation.set_speed(speed * $speed_mult);
...

// maybe something like this might be friendlier?..
let speed = blenvy_animation.speed(players);
blenvy_animation.set_speed(players);

the API obviously not the best, for one: it might be possible to get the relevant players from blenvy plugin, but I'm not a bevy expert so do not know at the moment

I will try to sketch a solution after jam :)

olekspickle avatar Jan 30 '25 18:01 olekspickle