From a4a15552bcc15e13849b112dfb1cac7287f98494 Mon Sep 17 00:00:00 2001 From: "Alec G. Moore" Date: Thu, 27 Jan 2022 16:11:07 -0500 Subject: [PATCH] Initialize hideHighlight in Interactable.cs Fixes issue where creating Interactables at runtime by using AddComponent() on a GameObject would throw null reference exception due to hideHighlight not being initialized, preventing itself and its children from showing highlighting. --- Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs index 1b436f79..af5f821f 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs @@ -67,7 +67,7 @@ public class Interactable : MonoBehaviour protected SkinnedMeshRenderer[] existingSkinnedRenderers; protected static Material highlightMat; [Tooltip("An array of child gameObjects to not render a highlight for. Things like transparent parts, vfx, etc.")] - public GameObject[] hideHighlight; + public GameObject[] hideHighlight = new GameObject[]{}; [Tooltip("Higher is better")] public int hoverPriority = 0;