From a073c19e9c384425a5b976aee01f744ab888b3c6 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Tue, 12 Oct 2021 01:57:11 +0200 Subject: [PATCH] cleanup --- src/addons/openvr_overlay/interaction/OverlayArea.tscn | 2 ++ .../openvr_overlay/interaction/overlay_interaction.gd | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/addons/openvr_overlay/interaction/OverlayArea.tscn b/src/addons/openvr_overlay/interaction/OverlayArea.tscn index 6825095..f45c2da 100644 --- a/src/addons/openvr_overlay/interaction/OverlayArea.tscn +++ b/src/addons/openvr_overlay/interaction/OverlayArea.tscn @@ -5,6 +5,8 @@ resource_local_to_scene = true extents = Vector3( 0.2, 0.2, 0.01 ) [node name="OverlayArea" type="Area"] +collision_layer = 0 +collision_mask = 6 [node name="CollisionShape" type="CollisionShape" parent="."] shape = SubResource( 1 ) diff --git a/src/addons/openvr_overlay/interaction/overlay_interaction.gd b/src/addons/openvr_overlay/interaction/overlay_interaction.gd index e3c5562..8a0b888 100644 --- a/src/addons/openvr_overlay/interaction/overlay_interaction.gd +++ b/src/addons/openvr_overlay/interaction/overlay_interaction.gd @@ -103,11 +103,9 @@ func _update_target(): _left_is_activator = t != "left" _right_is_activator = t != "right" - # toggle appropriate colliders - #$VR/left/OverlayActivator/Collision.disabled = !_left_is_activator - #$VR/right/OverlayActivator/Collision.disabled = !_right_is_activator - _overlay_area.collision_mask = int(t!="right")*2 - _overlay_area.collision_mask += int(t!="left")*4 + # make area only detect colliders of a different hand + _overlay_area.collision_mask = int(t!="right")*2 # detect right hand + _overlay_area.collision_mask += int(t!="left")*4 # detect left hand func _update_modules():