Hey. I created particles with physics (they are rigid bodies) and I added an AnimationPlayer node to queuefree() them after a few seconds. I added the queuefree function in a script running on each rigid body particle.
The problem is that, when the AnimationPlayer runs the queuefree function after a few seconds, the game crashes and I get a Stack Overflow (Stack Size: 1024) error message. Do I have to manually resize the stack or is there another way to queuefree scenes via the animation player?
Scene structure:
-RigidBody2D
---CollisionShape2D
---Sprite
---AnimationPlayer (calling queue_free())
---VisibilityNotifier2D (to remove when it's outside of the window)
Code:
func queue_free():
queue_free()
Error:
Stack Overflow (Stack Size: 1024)