AlGolden Posted November 30, 2020 Posted November 30, 2020 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
dario Posted January 5, 2021 Posted January 5, 2021 @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);
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now