Files
fps_project_1/scripts/level_bounds.gd

10 lines
299 B
GDScript

extends Area3D
func _on_body_exited(body: Node3D) -> void:
print("PLAYER OUT OF BOUNDS")
var level_control = get_tree().current_scene
if level_control.gamemode.die_on_leaving_bounds == true:
get_tree().current_scene.die()
else:
body.global_position = body.last_ground_pos + Vector3(0,10,0)