- Home /
Question by
razorianbuck · May 22, 2021 at 07:31 PM ·
vrinteractionsockets
Need help with Socket Interactor
Im 3 months new to C#. In my VR game, I put in this code so that one hand couldn't grab objects out of the other hand. However, the code now prevents me from grabbing objects from Socket Interactors that are in my scene. The code in on my object.
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class TheObject : XRGrabInteractable
{
public override bool IsSelectableBy ( XRBaseInteractor interactor )
{
bool isalreadygrabbed = selectingInteractor && !interactor.Equals(selectingInteractor);
return base.IsSelectableBy(interactor) && !isalreadygrabbed;
}
}
Comment