godot-third-person-basic-scene/maps/water-zone.gd

11 lines
230 B
GDScript

extends Node3D
func _on_underwater_body_entered(body):
if body.has_method("enter_underwater"):
body.enter_underwater()
func _on_underwater_body_exited(body):
if body.has_method("exit_underwater"):
body.exit_underwater()