Getting Started in VR | Physics-Based Hands | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Thanks! I subscribed and will check this out tomorrow

👍︎︎ 2 👤︎︎ u/DarthJandis 📅︎︎ Jan 12 2021 🗫︎ replies
Captions
good day everyone welcome back to the channel today we are looking at um making the virtual hands interact with the environment so basic physics on your hands in the previous episode we set it up our basic custom player controller so we actually gonna be using it as you can see there's only one script and and when all suggest all the objects are p preset so to start off we're gonna change this name to right and position and we can change this one's name to left hand position to set up the system that will take care of um interacting in the world and actually ensure that your physical hands then go through objects we are going to be setting up a basic um physics constraint so it's just going to be like a thread between two objects for one object is going to be where the position of the hand is and the second object is going to be the position of physics based objects so if your virtual hand goes through something in the world your virtual hand will stop and actually interact with the virtual object we're going to make it a child of the hand position and we're just keeping the name except for making it right physics constraint and we can add another one physics constraint on the left hand and we're just gonna be making it a left hand physics constraint now that the constraints are actually set up our objects are actually set up we should actually go and look at all the settings so the first thing that we gonna be going to is disabling the collider collision we don't want the constraints to actually collide with anything so we're just going to be deactivating that and we are going to changing the projection layer ah linear so it's just basic strength i'm just gonna change that to a higher value of a thousand three hundred all values that i'm gonna be changing in this project you have to actually go physically play with them i will tell you which values you should look out for um so that it doesn't force the object to actually go into the object that you're trying to avoid so on the limiters which is going to make them all free and then under the monitor section we're just going to be activating all the check boxes we're not going to change any of these values except for the strength we're going to take it up to 500 best value i've seen worked for best it's best you play with this value but at the same time don't make it too high um because if you make this strength value of a position too high and you actually put your controllers through let's save a wall at some point your virtual hands will then also be popping through the wall because of the strength of the position monitor and we're just gonna be changing this to 50 the next thing that we're going to be looking at is the angular motion we're going to change this to twist and swing reason why we're changing it to twist and swing is this is my own preference but if you actually move your hand really fast it will not just um be like a um a one motion type of thing where it will uh just follow your hands but it will actually have a bit of an extra motion of going over the object and going back but i'll show you that in a second just select the twist and swing and change this valley to 1500 same on bottom twist and swing and this again to 50. that's all the settings that you have to actually change i would definitely tell you to go and play with all of the strength values uh preference to your own project you can also change this to that is lerp and then but if you do that if you change the slurp you only have those values so at random date your own preference go and play with these values go play with between those two settings which one is going to be best for your own project the last thing that we just have to do is we have to ensure that the um physics constraint is actually zeroed out on the location so it will be exactly where the hand is the next thing that we're going to do is we're going to select the physics constraint on the left hand and i'm just going to be doing the exact same thing okay the last object that we actually gonna be adding is our virtual hands so selecting the motion controllers selecting the right motion material i'm just gonna add another cube and i'm gonna call it our hand model select the left hand motion controller add a cube on that and also call it left and model okay so for the properties i'm just going to change the scale to 0.1 on all axes on both cubes and i'm just going to change the color of a material to a different color just so that we can see exactly what's going on the moment you'll see there are two cubes but it's just gonna be there for showcasing at the end of a video i'll show you how to just deactivate the visuals of the second our first cube the last thing that we'll have to do is actually set up the collision so on the right hand position we're gonna change the collision to instead of block all we are gonna say custom and we're gonna make get ignore all same on the left hand position changing from block all to custom and just say ignore all on the left hand um model just ensure that when it comes to the collision it will say block all dynamic same on the right hand model just to ensure that that setting is active on the invent craft we're gonna go to the event beginplay and we're gonna actually add a sequence the first one in the sequence will definitely be um to set tracking origin remember this is just for oculus and vive uh in the future i'll show you how to set up for the google cardboard and psvr some settings are just a bit different so after we made the sequence it's gonna bring in the right physics constraint and we're gonna say set constraint components and this will assign of all the components of the constraint instead of actually going to the constraint and manually adding the names and stuff like that so we're going to start on the right hand the first constraint is going to be your right hand position and the second constraint is going to be your right hand model and then the last thing that we want to do is drag off from the right hand model and we just want to enable physics um set simulated physics and hook it up after the constraint and remember to actually uh activate the boolean for the simulation let's connect that up to the sequencer and we're gonna do exact same thing with the left hand so we're gonna say set constraint components and we're gonna bring in the left hand position and the left hand model on the second component and then we also just gonna set simulated sonata physics on the left hand model and we're just gonna get up to the sequencer i'm gonna complete save everything and that's about everything that you'll need to be doing for code wise let me quickly jump into the vr set press play and as you can see we have two cubes remember i'm fortunate a bit far away from table let me quickly just change that play again and we're at the table and as you can see the white cubes represent where my hand is and the blue cube is actually my virtual hand and as you can see they will stop and actually interact with the physics on the table and all other cubes and i can actually pick up the cubes by putting both hands together without any code necessary to pick up objects this is one way of actually interacting with the world if this is a mechanic that you would like in your game that's basically how you do it quickly jumping out of vr and i'll quickly show you how to hide the controllers of a position okay so all that works now we go back to player script and we're gonna go to a right hand position and just deactivate its visibility okay that is about everything that you need to be doing for making physics physics based hands if this was educational then to like if you enjoyed the video for any future content on virtual development for unreal engine meant to subscribe and stay notified when the next video is going coming up and i'll see you all in the next video
Info
Channel: Raptor Tech
Views: 5,024
Rating: undefined out of 5
Keywords: unreal engine, unreal engine 4, unreal, unreal engine getting started, vr game development in unreal engine 4, unreal engine game design getting started, unreal engine vr, unreal engine (video game engine family), game engine, physics, unreal engine 4 physics, unreal engine 4 vr, learning vr in unreal engine 4, unreal engine starter content import, unreal engine 4 tutorial, how to make characters in unreal engine 4, installing unreal engine, unreal engine textures
Id: L0nSNMwgc5Q
Channel Id: undefined
Length: 15min 52sec (952 seconds)
Published: Mon Jan 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.