0 votes

Basically I have a health bar that is animated using the animationPlayer node and I want to jump to a specific frame to represent the players health.

I can't seem to figure out how to set an animation to a specific frame/time.

in Engine by (103 points)

1 Answer

+2 votes
Best answer

i found this in documentation:

void seek ( float seconds, bool update=false )
Seek the animation to the seconds point in time (in seconds). If update is true, the animation updates too, otherwise it updates at process time. Events between the current frame and seconds are skipped.

$animationPlaye.seek(0.05, true) # show current animation on frame time 0.05

by (184 points)
selected by

LOL I swear I tried that earlier but couldn't get it to work. Anyway thank you so much, I managed to get it to work now.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.