Jump to content

Recommended Posts

Posted

Hi, could you please recommend the best way to get ViveRole during AfterGrabbed Event.

The task - i get the drill with left or right hand. I need to switch vibration on left or right hand inside AfterGrabbed() function. How can I know what hand is holding the drill?

I wanted to use BasicGrabbable.currentGrabber but it seems it is not the link to the hand gameObject.

What is the right method  to get ViveRole to call ViveInput.TriggerHapticVibration? @chengnay

  • 1 month later...
Posted

@AlGoldenwere you able to resolve? For others asking about this:
 

    public void OnGrabbed(BasicGrabbable grabbedObj)
    {
        ViveColliderButtonEventData viveEventData;
        if (!grabbedObj.grabbedEvent.TryGetViveButtonEventData(out viveEventData)) { return; }

        switch (viveEventData.viveRole.ToRole<HandRole>())
        {
            case HandRole.RightHand:
                if (rightGrabbingSet.Add(grabbedObj.gameObject) && rightGrabbingSet.Count == 1)
                {
                    ViveInput.TriggerHapticVibrationEx(HandRole.RightHand);
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...