2023-04-13 13:24:38 -06:00
|
|
|
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"):
|
2023-05-25 21:26:16 -06:00
|
|
|
var player = body.get_multiplayer_authority()
|
2023-05-29 15:46:12 -06:00
|
|
|
if Global.teddyAuthorityID == 1:
|
|
|
|
kill()
|
|
|
|
else:
|
|
|
|
rpc_id(player, "kill")
|
2023-04-13 13:24:38 -06:00
|
|
|
print("Player collided with a death zone!")
|
2023-05-25 21:26:16 -06:00
|
|
|
|
|
|
|
@rpc("any_peer", "call_remote")
|
|
|
|
func kill():
|
|
|
|
Global.player_dead()
|