Version:
Uuuh the current newest (like 4.0)
Question:
I’m making a game and I want an infinite loop, a simple while true kind of loop takes ages just to load into the game and doing a function that references itself at the end works a bunch better but I get infinite recursion error. There are 2 things I want to know, if you know the answer to either that’ll be great.
-
Is there an easy way to an infinite loop without the while true issue I had and with no errors ofc
-
How do I fix the infinite recursion error without making it no longer infinite
If you know the answer to any of these can I have an example of code because I’m new 

Why do you need an infinite loop? You are probably going about something the wrong way if you want a infinite loop.
I think the forum will need a lot more information before you’ll receive helpful support.
What are you trying to achieve? Can you post your code?
I mean, Godot itself provides infinite loops for you.
_process(delta)
And
_physics_process(delta)
Those are called every game tick and every physics tick, forever, for each active node.
Including the root node of your game.
These dont cause any crazy performance issues by themselves as they are integral parts of Godot.
2 Likes
About this infinite loop. You are talking about
func _process(delta):
func _physics_process
godot´s built -in function
It is usefull for all of thing you were thinking.
Just staring at this message helped me think of a new way. Thanks
I’ve thought of a way to fix it without an infinite loop but I just want it to work like a while statement that just loops back to it instead and I already tried that when I put it under _process it looked weird but thanks for the help anyways
Yeah, I’ve already replied to a comment saying the same thing but long story short I think I know how to fix the issue, thanks anyways
1 Like
But I could tell you _process and physics_process are two threads specialized to solve concurrent problem and the signals too.
coroutine
ex func example() → signal:
return Signal…
await
Just review them…!!!