Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ToxicFrog on November 21, 2017, 05:32:17 PM

Title: Setting up VR Door with hinges to follow hand
Post by: ToxicFrog on November 21, 2017, 05:32:17 PM
Hi, Playmakers!

I have a door on a Hinge Joint that has limited rotation (0 to 90).

I want to grab the handle of the door, and have it rotate on the Hinge to follow the controller. When the handle is released, I want the door to close itself based on the Spring settings in the Hinge Joint.

I've got a trigger volume that tests whether the handle is 'gripped', which works.

However, I have not been able to find a way to make the door rotate to follow the controller while respecting the limits of the hinge.

I tried a 'LookAt', which works in a way, but it does not respect the Hinge (meaning it will rotate past the limits set in the Hinge Joint).

I'm on the Rift currently, but I want to make something that will work with Vive as well.

Any suggestions?

Thanks, and I'll reply with results from any suggestions!
Title: Re: Setting up VR Door with hinges to follow hand
Post by: LordHorusNL on November 22, 2017, 11:37:53 AM
Hi there ToxicFrog.

Most people here will advise you to try VRTK with the Playmaker actions, however i had some problems with VRTK so i dicided to make my own full physics driven interaction system.

So if you just want to use Playmaker, this is what you'll want to do. (there are other ways but this works the best with physics)

Make sure your hands/controllers have a rigidbody on them with gravity/kinematic set to off.

Then integrate the following actions in your door/interactons script to make the door follow the hand/controller.

(Check Every Frame on all actions)

That should work depending on how your interaction Fsm is setup.

If you have any problems with that just let me know.
Title: Re: Setting up VR Door with hinges to follow hand
Post by: ToxicFrog on November 22, 2017, 03:26:52 PM
Thanks, LordHorus!
I managed to get it working as intended with VRTK this morning. So far, so good. But, if I encounter any issues I will try your method next.
I appreciate your help!
Title: Re: Setting up VR Door with hinges to follow hand
Post by: LordHorusNL on November 22, 2017, 04:15:13 PM
Good to hear!

VRTK will do just fine for most games.