-
Hi, I have been trying to pause the animation on a tile by using a query like this:
My printlns come out correctly, but the animation does not pause when I set speed to 0. |
Beta Was this translation helpful? Give feedback.
Answered by
rparrett
Oct 8, 2023
Replies: 1 comment 1 reply
-
This looks like a bug. I opened a pull request to fix it here: #474 You can work around it by triggering change detection on another tile property like color: fn pause_animation(
mut query: Query<(&mut AnimatedTile, &mut TileColor)>,
keys: Res<Input<KeyCode>>,
) {
if keys.just_pressed(KeyCode::P) {
for (mut anim, mut color) in &mut query {
anim.speed = if anim.speed == 0.0 { 1.0 } else { 0.0 };
color.set_changed();
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ifbsj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This looks like a bug. I opened a pull request to fix it here: #474
You can work around it by triggering change detection on another tile property like color: