How to make a static body 2D spawn

Godot Version

4.6

Question

I have some static body 2Ds and I have it so when one is clicked it disappears (queue_free) and I want to make it so when one is clicked the previously clicked one will respawn in the same place (if that makes sense) though I am new to godot and have no idea how to do this any help would be appreciated

If you share code, please wrap it inside three backticks or replace the code in the next block:

func _ready() -> void:
    print("hello world")

If you delete the object, then it can’t run code any more. Maybe it would be better for you to disable and hide this static body instead of using queue_free(), then you can re-enable it on a timer.