- Home /
How to add Steam Vr Script "Interactable" during runtime without crashing on interact
While trying to Instantiate a Sphere and add "interactable" Spheres[i].AddComponent(); I get an error from the SteamVr Interaction script The error only happens when i add it during run time.
Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs:130
protected virtual bool ShouldIgnore(GameObject check)
{
for (int ignoreIndex = 0; ignoreIndex < hideHighlight.Length; ignoreIndex++) //Highlighted: 130
{
if (check == hideHighlight[ignoreIndex])
return true;
}
return false;
}
My Script
if(RightTrigger.lastState)
{
Spheres[verticesNum] =Instantiate(Sphere, rightHand.position, rightHand.rotation);
objVertices[verticesNum] = rightHand.position;
//Spheres[verticesNum].AddComponent<Interactable>(); // Error
}
Is there something I'm missing?
Comment