Search code examples
c#unity-game-enginehtc-vivevrtk

rotate kinematic cube with vive trigger, vrtk plugin


I know this question is kinda noob but I really need help with my project. I want to make a test application for VR using VIVE. I'm using Unity3D. I am able to grab a cube using VRTK and I change my grabbing control to grip_press. I only have one VIVE controller currently.

Questions:

  1. I want to make player/user to grab the object and place it on a table. After user has placed the object;

[Option 1]:

the grab script will be disable and rotate script will be enable allowing user to press trigger and move left/right to rotate the object like OnMouseDrag example: https://www.youtube.com/watch?v=S3pjBQObC90

[Option 2]:

user grab object by trigger press and rotate cube by grip button. How to achieve this if I only one a particular object to be use by grip while other usable objects by trigger_press?

[Option 3]:

grab script will be disable and when the VIVE controller touches the object user can just move left/right to rotate the object.

Which options would be easy to execute?

  1. I would like to know whether it is possible to teleport and use the pointer to rotate the cube. In VRTK tutorial it shows you can teleport and grab object, but i want to rotate the cube like in whirlygig, 019_Controller_InteractingWithPointer while able to teleport.

Thank you.


Solution

  • In relation to your section question. Yes it's possible to have the pointer call the use action and also allow you to teleport.

    The example scene you mention uses the Pointer activates use action setting on the Interactable Object (as in that setting is ticked).

    If you untick that setting, and tick on the pointer script the Interact with objects setting.

    Then when you put your pointer over something, it won't automatically activate it but it will activate when you press your use button (e.g. your trigger).