How to control the animation play to a specified time at once?


For example, I have a animation named ‘run’, and it lasts for 1 second, I want to control node to play the ‘run’ animation to 0.5 second.
This is my code section:


But it doesn’t work, the node dosen’t play animation to the time.


I need this for the editor, so I can control the animation playing by the slider