TCG VR #1 | Oculus Quest Hand Tracking | Pinch, Grab, Poke

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everybody this is the scene I've been working on since the last video this is the arena which for now is just a plane with the checkerboard texture on which we summon a cube using some easy checkerboard logic the arena receives instructions from the card table using the card place controller and you can see it looks quite similar to the ER you know right now we know where replace the cards using these colliders and using the Associated name of the game object here we have the big cards that are our card in our hand and we reuse the same mesh for the smaller model that's going to be used on the card table for now we have a wreckless friendly-fire dwarf a not cool mate spell card and the fireball card concepts will be improved in time for the cards activated the simple mesh in blender that has attached to it two different materials one for the front and one for the back we do this so we can use only once the texture for the back and have enough space in the texture for the front one those are basically two spheres one within each other with a transparent material now how did I manage to add all these your capabilities you ask well most of them are inside this free unity package called oculus integration once imported you will have everything you need inside this folder named oculus all you have to do is delete on your main camera and import the of your camera rig prefab open build settings and switch your platform to Android open player settings put the company name and the product name make sure you put a correct package name combining those two set the minimum API level to at least 19 and enable Victoria it is supported add oculus here oh and almost forgot remove Vulcan from graphics API so you make sure the build works connected oculus quest and press build and run that's it now you have the most basic all to the SAP ever hand tracking setup now that you can see around let's add hand tracking support on this thing for this select of your camera rig and make sure hand tracking support is either controllers and hands for hands only search for of your hand prefab and put it inside the left hand anchor and right at hand anchor each prefab has an over hand script and has components for the skeleton and the mesh it's rigged in to make sure the left hand has selected hand left in these three places make sure the right hand has the same thing in those few places for the hand right enabled physics capsule on the right hand since we will use it for the toggle in the future voila now you can see your hands although they do not do a thing grabbing a card is basically having your hand really close to it and putting your thumb and your index finger together you stop grabbing when you stop pinching for this our hands should have a behavior that inherits of your grabber class notice how most scripts in oculus integration start with all the are and the cards should have a behavior that inherits all VR grabbable since we should know they are grabber balls also make sure each of them has a rigid body and the box Collider and our hands has a rigid body and the sphere Collider make sure those are set to trigger let's look at our grabbing behavior that inherits the OVR grabber inside the grabber we will check at each frame if there is pinching if we don't already hold an object there is a valid candidate close enough to our hand and we beat pinch hard enough we call begin grab from the inherited class otherwise if we already hold an object but we don't pinch hard enough we will release that object by calling grab and whenever overriding an existing method be sure to call the base method first so you don't break any existing behavior don't hesitate to look into the parent class as you will learn lots of stuff for instance you could see it works out of the box with a touch controller now let's look into the group card grabbable script that inherits all vr grabb over all we do here is we wait for the grab bands to be called and then make sure our custom behavior is called if you randomly release the card it will come back up but it was at the start otherwise we tell the arena manager to summon a cube and we will instantiate a prefab of the smaller card on the table that's it now you can grab a card with someone the cube but it's annoying we cannot see a thing because of our huge cards but we have to keep them huge so we can all read the small text this pokéballs fear works as a toggle to hide show the cards there are two states hovered in the outer sphere and active in the Inner Sphere for this we inspired a lot from an existing script called fingertip poke tool which is inside the sample framework folder inside oculus this folder has several other useful tools as well as some example scenes inside the usage folder these scripts works well together with button controller which has free zones the proximity one contact one and action one I'm a minimalist so I'll make my own stripped-down version of this pair this is our version called fingertip poke interaction we do all the logic inside the core routine because we do not know when the hands manager is going to be instantiated and initialized after that we get the fingertip of the index finger of the right or hand or left hand based on a boolean all this can be fine inside hands manager what we do is get the capsule Collider on that bone and then attach to it a custom component named bone trigger logic remember to check enable physics Collider on the hand you use it on we are the burn trigger logic component so we can recognize it on our toggle behavior when it enters the trigger it would have been easier to give it a tag or to put it inside a layer but I want the OVR way that's it now we can listen inside the toggle game object in the function ontriggerenter or or to ontriggerexit and do whatever we want with it for instance we will change the materials of the spheres and make sure to hide or show the cards based on those states this week I went to setting up oculus adding hand tracking and learn how to poke and grab objects check out the examples inside oculus sample framework usage for more interactions in the next video I'll implement a couple more interactions and then start doing the same for controllers will also implement controllers since the hand tracking is a bit Wiggly for now and it might be annoying on the eyes to read the text also I might improve the placing card logic since it's tricky to place a big card in a small place questions feedback and future suggestions are more than welcome please like and subscribe if you enjoyed see you next time [Music]
Info
Channel: ColorfulCoding
Views: 7,247
Rating: undefined out of 5
Keywords:
Id: fSDejIg2emU
Channel Id: undefined
Length: 7min 34sec (454 seconds)
Published: Mon Feb 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.