I got the error StackOverflow

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Landro974

Thanks a lot for your answer but I get the error stactkOverflow I tried to put 1 in the instantiate but it doesn’t work

var newpousse = load("res://Plants/Fruit1.tscn").instantiate()
get_parent().add_child(newpousse)

You can’t get a stack overflow error with this code. You probably have a recursive function somewhere. A recursive function is a function that calls itself. You get a stack overflow error when a recursive function calls itself indefinitely

Enfyna | 2023-06-25 02:26

If you have that code in the _ready function of your Fruit1 scene, then that is the bug

godot_dev_ | 2023-06-25 02:44