24 lines
445 B
GDScript
24 lines
445 B
GDScript
extends Spatial
|
|
|
|
var cursor = weakref(null)
|
|
|
|
signal cursor_interact
|
|
|
|
func set_cursor(set_as: Node):
|
|
cursor = weakref(set_as)
|
|
|
|
func is_cursor_collision(body):
|
|
return get_cursor() == body
|
|
|
|
func fire_interact():
|
|
emit_signal("cursor_interact")
|
|
|
|
func get_cursor():
|
|
return cursor.get_ref()
|
|
|
|
|
|
# Interact events:
|
|
#########################################
|
|
func _on_Interact_leave_disclaimer():
|
|
var _err = get_tree().change_scene("res://world.tscn")
|