0 votes

I want to put my player in a "Slowed" state for like 3 seconds before giving him his original walking speed. I thought i could use a countdown with the Timer node but that didn't really work out for me since i didnt know how to do it exactly.Thank you.

Godot version 3.2.3
in Engine by (17 points)

1 Answer

0 votes
Best answer

Try this example inspired by the official documentation:

func slowdown():
     var previous_value = some_variable
     yield(get_tree().create_timer(1.0), "timeout")
     some_variable = previous_value
by (2,394 points)
selected by

It worked ! Thanks a lot !

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.