project_teddy/scripts/death_collider.gd
2023-05-25 21:26:16 -06:00

19 lines
498 B
GDScript

extends Area3D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
for body in get_overlapping_bodies():
if body.is_in_group("human"):
var player = body.get_multiplayer_authority()
rpc_id(player, "kill")
print("Player collided with a death zone!")
@rpc("any_peer", "call_remote")
func kill():
Global.player_dead()