2018-07-19 15:37:14 +02:00
|
|
|
extends Spatial
|
|
|
|
|
2019-02-14 14:20:44 +01:00
|
|
|
signal body_entered()
|
|
|
|
|
2018-07-19 15:37:14 +02:00
|
|
|
func _ready():
|
|
|
|
get_node("Area").connect("body_entered", self, "collided")
|
|
|
|
|
|
|
|
func collided(body):
|
|
|
|
if body.has_method("reach_goal"):
|
2018-11-05 14:01:52 +01:00
|
|
|
get_node("ShineRays").hide()
|
2018-11-07 13:25:04 +01:00
|
|
|
|
2018-08-09 14:01:41 +02:00
|
|
|
body.reach_goal()
|
2018-11-05 14:01:52 +01:00
|
|
|
|
2018-08-09 14:01:41 +02:00
|
|
|
# Should be done in vertex shader
|
|
|
|
#func _process(delta):
|
|
|
|
# var camera_pos = get_viewport().get_camera().global_transform.origin
|
|
|
|
# camera_pos.y = 0
|
2019-02-14 14:20:44 +01:00
|
|
|
# look_at(camera_pos, Vector3(0, 1, 0))
|
|
|
|
|
|
|
|
func _on_Area_body_entered(body):
|
|
|
|
emit_signal("body_entered", body)
|