Skip to content

Commit

Permalink
avoid panic, add current time when time can be casted to float
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm committed Sep 30, 2024
1 parent 692780d commit 5efee89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/godot_classes/animator_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ impl MultipleAnimationController {
self.current_time.remove(&anim.clip);
} else {
let time = self.base().get(anim_state.time_param_ref_str.clone());
self.current_time
.insert(anim.clip.clone(), time.to::<f32>());
if let Ok(time) = time.try_to::<f32>() {
self.current_time.insert(anim.clip.clone(), time);
}
}

self.playing_anims.remove(&anim.clip);
Expand Down

0 comments on commit 5efee89

Please sign in to comment.