A few things:
1: The main misunderstanding here, as others have mentioned above, is you’re confusing the scene with the instance of the scene.
water_person is your scene (PackedScene). When you do:
var person_spawn_w = water_person.instantiate()
add_child(person_spawn_w)
person_spawn_w is an instance of the scene. You correctly add the instance as a child of the current scene.
So when you want to reference the instance in the future, you have to call it specifically, not the water_person scene it was instantiated from. I.e. you need to call the person_spawn_w object.
But how? The var reference to person_spawn_w is lost from scope after your if statement. So you need another way to call it.
There are a few ways you can do this, I’ll show you one using “groups”:
If you add your water people to a group, you can loop through them later:
if water_ordered:
var person_spawn_w = water_person.instantiate()
add_child(person_spawn_w)
person_spawn_w.add_to_group("water_people")
Then later you can loop through them:
for water_person in get_tree().get_nodes_in_group("water_people"):
...<do something with water_person>...
2: To get rid of a node you don’t change .visible (that’s just visibility), you should use queue_free().
E.g.
for water_person in get_tree().get_nodes_in_group("water_people"):
water_person.queue_free()
The above will clear all instanced nodes in the water_people group.
3: It’s unclear in your question what you mean by “despawn a person whenever they get their order”. You’ve only shown that you are instancing water_people, but you don’t show us how you are recording that they were given water. You would have to set some kind of tracking property on the water_people to do that. Then (let’s say your tracking prop is called “received_water”), you could do something like:
for water_person in get_tree().get_nodes_in_group("water_people"):
if water_person.received_water:
water_person.queue_free()