cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus.Interaction.HandGrab.HandGrabInteractable.Colliders needs a refresh feature?

Mikyjax
Protege

Hello,

I had this case where the parent has the HandGrabInteractable component and then add some children colliders at runtime, they are also HandGrabInteractable.

Now if I delete those children at runtime (which I need in the game) it doesn't remove those children colliders from the parent HandGrabInteractable.Colliders[] and as soon as you put your hand inside that parent colliders you get missing collider error. so it didn't update the Colliders[] when destroyed.

The only fix I found was to add:

public void RefreshColliders()
{
Colliders = Rigidbody.GetComponentsInChildren<Collider>();
}

in HandGrabInteractable.cs and call it in my fixedUpdate in the case a children collider has been deleted.

But I will need to change that each time i update the sdk so it's not ideal.

Is there a cleaner way that I missed to achieve the same result? Right now the Colliders are only set in the Start() function of HandGrabInteractable, in my opinion it should subscribe to those children and refresh when they got destroyed.

Thanks for your consideration

0 REPLIES 0