+1 vote

Im trying to stop the execution of a function for 1 frame. But my game is updating a lot faster than my screen, so sometimes if I change something before yield(gettree(), "idleframe") and then change it back after, it doesnt show up. My game updates arround 1000 times/sec.

Basically I want Unitys: yield return new WaitForEndOfFrame();

Thanks in advance :)

in Engine by (22 points)

Yield will stop the process for a frame and requires resume to continue. Are you resuming?

Know it's not the same technically, but maybe just yield(get_tree(), "physics_frame"). Since practically it would fulfill most use cases I think. Don't think there is any way to do what you want directly, there is no api to get screen refresh rate currently...

1 Answer

0 votes


yield(VisualServer, 'frame_pre_draw')


yield(VisualServer, 'frame_post_draw')
by (268 points)
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 Frequently asked questions and 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 [email protected] with your username.