ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
357 stars 82 forks source link

Wave VR Button To Trigger #164

Closed nantianliao closed 4 years ago

nantianliao commented 4 years ago

What should I do to be like this? It can be configured with multiple trigger buttons. Button To Trigger

chengnay commented 4 years ago

@nantianliao To my understanding, you would like multiple buttons to perform like Trigger button? For example, trigger button can grab an object, you would also like to grab with touchpad or grip button?

nantianliao commented 4 years ago

@nantianliao To my understanding, you would like multiple buttons to perform like Trigger button? For example, trigger button can grab an object, you would also like to grab with touchpad or grip button?

@chengnay Yes, What should I do about this situation?

chengnay commented 4 years ago

You might need to modify BasicGrabbable.cs script, For example, [SerializeField] private ColliderButtonEventData.InputButton m_grabButton1 = ColliderButtonEventData.InputButton.Trigger; [SerializeField] private ColliderButtonEventData.InputButton m_grabButton2 = ColliderButtonEventData.InputButton.PadOrStick;

Under OnColliderEventDragStart function, if (eventData.button != m_grabButton1 && eventData.button != m_grabButton2) { return; }

I will attach my sample script for your reference. BasicGrabbable.zip

nantianliao commented 4 years ago

@chengnay Thank you for your answer. Your reply helped me to solve the problem. My requirement is not to use the second trigger button to grab objects, but to use the second trigger button to interact with the UI. Now I've added a second trigger button to vive raycaster.cs to implement my requirement.

chengnay commented 4 years ago

@nantianliao If your problem is solved, please help to close this issue, thanks!