Skip to content

Commit 5301cc3

Browse files
committed
Add example for transition
1 parent 4c09495 commit 5301cc3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/animation/animated_fox.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Plays animations from a skinned glTF.
22
33
use std::f32::consts::PI;
4+
use std::time::Duration;
45

56
use bevy::prelude::*;
67

@@ -122,7 +123,10 @@ fn keyboard_animation_control(
122123
if keyboard_input.just_pressed(KeyCode::Return) {
123124
*current_animation = (*current_animation + 1) % animations.0.len();
124125
player
125-
.play(animations.0[*current_animation].clone_weak(), None)
126+
.play(
127+
animations.0[*current_animation].clone_weak(),
128+
Some(Duration::from_millis(250)),
129+
)
126130
.repeat();
127131
}
128132
}

0 commit comments

Comments
 (0)