0 votes

I'm abusing of yield and signals. However, there are situations that some of my methods are yielding (and invalidating) only when certain conditions are met, otherwise do nothing.
Since the calling method of those methods are yielding those, I invalidate those no matter the conditions (because an exception occurs when yielding a method that does not invalidate) by doing yield(get_tree().create_timer(0), "timeout") when the methods does nothing, but needs to be invalidated. Is there a more elegant way of instantly invalidating a function without doing this every time?

in Engine by (16 points)

1 Answer

0 votes
yield(get_tree(), "idle_frame")
by (1,939 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.