1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-29 03:04:17 +00:00
pineapple-surf/island/sinking/SinkArea.gd

15 lines
321 B
GDScript3
Raw Normal View History

2023-01-09 11:35:14 +00:00
extends Area3D
class_name SinkArea
## A node fell in the water.
## Triggers after CanSink.sunk .
signal has_sunk(sinkable: CanSink)
2023-01-09 11:35:14 +00:00
func _on_body_entered(body: Node3D):
var sinkables = body.find_children("*", "CanSink", false, false)
2023-01-09 11:35:14 +00:00
for sinkable in sinkables:
sinkable.sink()
emit_signal("has_sunk", sinkable)