From 5605934e03b7d3b23a6882ec4e262ff96b245594 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Thu, 25 Apr 2024 17:28:17 +0200 Subject: [PATCH] delete occludable --- app/content/functions/occludable.gd | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 app/content/functions/occludable.gd diff --git a/app/content/functions/occludable.gd b/app/content/functions/occludable.gd deleted file mode 100644 index 432b004..0000000 --- a/app/content/functions/occludable.gd +++ /dev/null @@ -1,20 +0,0 @@ -extends Function -class_name Occludable - -var ray := RayCast3D.new() -@onready var player_camera: XRCamera3D = get_node("/root/Main/XROrigin3D/XRCamera3D") - -func _ready(): - ray.set_collision_mask_value(1, false) - ray.set_collision_mask_value(5, true) - get_parent().add_child.call_deferred(ray) - - EventSystem.on_slow_tick.connect(_slow_tick) - -func _slow_tick(_delta): - if player_camera.is_inside_tree() == false||ray.is_inside_tree() == false: - return - - ray.target_position = get_parent().to_local(player_camera.global_position) - - get_parent().visible = ray.is_colliding() == false