AnimationPlayer not stoping, even using stop(true) method Godot 3.0

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zhangyao

Hi geniuses on this section, this is very weird, I have a animationplayer which has a node lined 2d, I want it to decrease in length while the time is running, when button paused, it should pause the animation, when button resumed, it should go on by the position before pause.

There are actually two problems,

  1. the animationplayer doesnt stop, I tried stop(true) and (false) and none works,
  2. the resume doesn not work, I tried using code 1 when paused and code 2 when resumed.

code 1

PausePosition = $AnimationPlayer.get_current_animation_position()
$AnimationPlayer.get_current_animation()
$AnimationPlayer.stop(true)

code 2

$AnimationPlayer.seek(PausePosition, true)

Any help is appreciated!