So, in the _on_Area2D_body_entered()
method, body
contains a reference to the specific body instance that was contacted. So, in that method, you want to use body
to reference that instance.
Without seeing some code, I'm just guessing, but I assume the the greenslime instance you created "manually" via .instance()
(in your above example) is a different, separate instance of the same scene. So, calling dead()
on that instance should work (for that instance), it will not impact any other instance.
So, bottom line, I assume you have (at least) 2 independent greenslime instances in the scene in your test. Interacting with one will not impact the other.