aboutsummaryrefslogtreecommitdiffstats
path: root/godot/scenes/objects/GoalTriggerBox.gd
blob: 208a2f356323d9c28ec98f6ee14b646513399084 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
extends Area

var loader


func _on_GoalTriggerZone_tree_entered():
	loader = get_node("/root/Game")


func _on_GoalTriggerZone_body_entered(body :RigidBody):
	# return when body is not a rigidbody
	if body == null:
		return
	
	loader.end_level()