How to delete clones when touch wall?

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

I have a bullet and when the bullets touch wall it just stay there making my PC lag
I want it so it will delete when touching the wall. I know how to delete but I don`t know how to detect.

:bust_in_silhouette: Reply From: exuin

If the bullet is not already an Area2D, give it one. Use a group for the walls or a physics layer. Connected the on_body_entered signal of the Area2D to a function that frees the node.