You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Added a more helpful error message when there is no current animation for the animation player
This commit is contained in:
@@ -1294,12 +1294,12 @@ bool AnimationPlayer::is_valid() const {
|
||||
}
|
||||
|
||||
float AnimationPlayer::get_current_animation_position() const {
|
||||
ERR_FAIL_COND_V(!playback.current.from, 0);
|
||||
ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation");
|
||||
return playback.current.pos;
|
||||
}
|
||||
|
||||
float AnimationPlayer::get_current_animation_length() const {
|
||||
ERR_FAIL_COND_V(!playback.current.from, 0);
|
||||
ERR_FAIL_COND_V_MSG(!playback.current.from, 0, "AnimationPlayer has no current animation");
|
||||
return playback.current.from->animation->get_length();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user