Godot Version
4.3 stable
Question
How do I repeat variable change for each node
func _on_interaction_range_area_entered(area: Area3D) -> void:
for self in get_nodes_in_group("savage_stars"):
alive = false
4.3 stable
How do I repeat variable change for each node
func _on_interaction_range_area_entered(area: Area3D) -> void:
for self in get_nodes_in_group("savage_stars"):
alive = false
if i am not mistaken, self points only to the object that the script is attached to
you need to make a variable for the thing you’re looping through
i havent tested this, but it should theoretically work
func _on_interaction_range_area_entered(area: Area3D) -> void:
for star in get_nodes_in_group("savage_stars"):
star.alive = false