Playmaker Forum

PlayMaker Help & Tips => VR Help => Topic started by: beowulfkaine on April 15, 2017, 05:14:51 PM

Title: Need help with a type of action for HTC Vive
Post by: beowulfkaine on April 15, 2017, 05:14:51 PM
Ok, so I'm not sure if I'm going to explain this correct but here goes:

I am making a Breaker box fuse puzzle. The puzzle is pretty simple, there is a breaker box and inside there are lets say 20 breakers of various AMP's. However there are 4 breakers that are either busted or missing.  The goal of the player is to find the 4 appropriate breakers in the room and replace or insert them in the correct slot.

So 4 slots, 4 breakers each 10/20/30/40 amps respectively. Player can mix and match the breakers in any slot and flip the breakers on one by one, but if the variable sent to the Boolean does not equal a certain number, then the check fails and  when the player pulls the main switch all the breakers blow and the animation is played for the down switch on each breaker.

My issue is how can I create the flow in PM that the player can pick up a breaker, parent it to either hand rotated correctly, allow the player to flip the switch on or off (in place or not) have the breaker snap to the position needed when the "button" whichever is used, and allow the player to pull out the breaker to test it in another spot if it does indeed fail?

I hope I explained what I am trying to do correctly, any help would be really appreciated!
Title: Re: Need help with a type of action for HTC Vive
Post by: tcmeric on April 16, 2017, 06:58:42 AM
Playmaker doesnt support HTC vive "out of the box". There are a few paid assets that allow playmaker to access some basic HTC vive functions. But I would look into the VRTK asset (which is free). Then use the custom playmaker actions I created, which bridge playmaker and VRTK, so they can be used together. I also have a bunch of youtube video tutorials.

I am not sure how familiar you are with vive programming and playmaker, so its hard to give specific advice. I think I sort of understand your desires.

I might use some "tricks" to make it work. For example, I would use VRTK to make a grab object (the breaker), which can be then picked up. When the correct breaker gets to the right place (use a trigger enter action), then the breaker in your hand is disabled (so it disappears).

A second breaker is already in place and already set in place nicely. (It is then enabled, so it looks like the first and second object is the same one). This allows it to go into place exactly. You could even have a third hidden one to show after the explosion, so it looks all charred. Playmaker has a tutorial about that as well, on their official channel (called breakable objects):
Start with this breakable tutorial if you are newer to playmaker and dont know how to do it.

You could also use VRTK snap in place type function. I dont have any tutorials on this one, but it could also be useful. I was thinking of making some specific playmaker actions for it (but you still need to learn how to do it in VRTK. They have examples of it in the VRTK asset).

A switch to pull is also part of VRTK. Its just like a door open. They also have examples of this in the VRTK asset.

You can find my custom actions here: https://github.com/dumbgamedev/VRTK_Playmaker3x/
VRTK is on the asset store for free.

Our playmaker slack channel is here: https://invite-playmaker-slack.herokuapp.com
(A bunch of us on the slack channel have VRTK games we are working on).

My youtube channel is here with tutorials: https://www.youtube.com/channel/UCyRBYRGl9v_byeKxT4GLG_A

This tutorial shows you how to setup a door with VRTK (how to use hinge joint in unity), which is like a lever:
Do these VRTK tutorials next to learn the basics of getting started with VRTK (before you do any of my tutorial above).

This shows to to install and get started with VRTK: This one shows VRTK how to setup your HTC controllers, pickup objects and use lasers:
Title: Re: Need help with a type of action for HTC Vive
Post by: beowulfkaine on April 16, 2017, 01:19:38 PM
Thanks for the advice! I'm farmiliar with VRTK and I own the playmaker tools asset from the asset store. I pretty much bought anything playmaker VR related in the store. There is one particular scene in the  RTK sample scenes #41 object snap. It's almost exactly what I'm looking for, in fact it's pretty much it. However they have not updated the documentation to cover it and I have tried to deconstruct the scene to make my own and I simple can't figure it out I have been trying for days, it's incredibly frustratiing. Are you at all farmiliar with this scene?
Title: Re: Need help with a type of action for HTC Vive
Post by: tcmeric on April 16, 2017, 02:23:28 PM
I am not actually. However, you are the second request regarding object snapping. Ill have a look at the demo scene and see what I can do.
Title: Re: Need help with a type of action for HTC Vive
Post by: beowulfkaine on April 16, 2017, 07:50:30 PM
I am not actually. However, you are the second request regarding object snapping. Ill have a look at the demo scene and see what I can do.

i'd really appreciate it it would help me a lot!
Title: Re: Need help with a type of action for HTC Vive
Post by: tcmeric on April 27, 2017, 07:54:06 AM
Just continuation of this thread. I created a few playmaker actions for snapping.

(Gets the gameobject leaving or entering the snap zones.)
ObjectEnteredSnapDropZone.cs
ObjectExitedSnapDropZone.cs
ObjectSnappedToSnapDropZone.cs
ObjectUnsnappedToSnapDropZone.cs


(Sets snap zone properties)
SetSnapDropZoneHighlight.cs   
SetSnapDropZoneHighlightActive.cs   
SetSnapDropZoneObjectOutline.cs   
SetSnapDropZoneScaling.cs   
SetSnapDropZoneSnapDuration.cs   
SetSnapDropZoneSnapType.cs
SetSnapDropZoneValidObjectList.cs   

No tutorial yet, but works with the example scene in VRTK.