Introduction to VR in Unity - PART 8 : SNAP ZONE

  Рет қаралды 58,188

Valem

Valem

Күн бұрын

Пікірлер: 117
@ValemVR
@ValemVR Жыл бұрын
Hey guys ! I made an update of this series on my channel Valem tutorial that you can find here : kzbin.info/www/bejne/nH6TnGWkbNprqcU
@sotogje
@sotogje 4 жыл бұрын
You are always suprising me offering the exact tutorial I am looking for
@jordyatondo1004
@jordyatondo1004 4 жыл бұрын
Ikr, I literally needed this yesterday, lol.
@AdrianMeredith
@AdrianMeredith 4 жыл бұрын
this is great! how about some enemies next? would like to know how to physically interact with another character with that lightsabre?
@magnusthomsen450
@magnusthomsen450 4 жыл бұрын
Thanks Valem 😁
@mironco9595
@mironco9595 4 жыл бұрын
Yay! I really like this series! Thanks for another episode
@riska52p
@riska52p 4 жыл бұрын
I love this series
@nein_3371
@nein_3371 4 жыл бұрын
i realy like how motivated you are in every video :D
@Rickmanx1972
@Rickmanx1972 4 жыл бұрын
Another excellent tutorial! And it is funny... I was about to work on creating drop zones for attaching swords and potions to a belt, but you saved me a bunch of time. Thanks again :)
@RigidDecay
@RigidDecay 2 жыл бұрын
Thank you so much! This helped me with my holsters, I love how it is extremely simple and intuitive.
@samcasters
@samcasters 4 жыл бұрын
Woudnt you be able to put anithing 9n your head is there a way to make it so you kan only put things on your head with a specific tag
@charlottedegooijer4536
@charlottedegooijer4536 3 жыл бұрын
A bit late, but for anyone still looking for this. Check out his second tutorial on creating a realistic gun, there he gives a script to extend the socket interactor with a tag.
@Kazumo
@Kazumo 3 жыл бұрын
@@charlottedegooijer4536 Thank you!
@LivanderGamedev
@LivanderGamedev 4 жыл бұрын
This is what I've been waiting for!
@richardosborn159
@richardosborn159 3 жыл бұрын
thank you for this high-quality info
@dimashutama9378
@dimashutama9378 2 жыл бұрын
how TF did you not get 1M view?, this tutorial is very good and explained really well.
@curranh.8328
@curranh.8328 4 жыл бұрын
You are very skilled. Great tutorial! Thank you for bringing this to the masses! 😁
@silwerifpv8395
@silwerifpv8395 4 жыл бұрын
Thank you for this excellent tutorial series! I'd like to report a bug that I found with XR Interaction Toolkit with URP on oculus go. Same issue might be with quest? XR Socket interactable is not working when project is using URP. Could you test this project on quest and see if the same bug remains?
@silwerifpv8395
@silwerifpv8395 4 жыл бұрын
Found the bug in XRSocketInteractor script on material creation on lines 74-88. After replacing the lines 74-88 with below code, the snap zones work on Oculus Go (possible issue on Quest too?): if (m_InteractableHoverMeshMaterial == null) { // create of default transparent shader var m_InteractableHoverMeshMaterial = new Material(Shader.Find("Universal Render Pipeline/Lit")); if (m_InteractableHoverMeshMaterial) { /* m_InteractableHoverMeshMaterial.SetFloat("_Mode", 2); m_InteractableHoverMeshMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); m_InteractableHoverMeshMaterial.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); m_InteractableHoverMeshMaterial.SetInt("_ZWrite", 0); m_InteractableHoverMeshMaterial.DisableKeyword("_ALPHATEST_ON"); m_InteractableHoverMeshMaterial.EnableKeyword("_ALPHABLEND_ON"); m_InteractableHoverMeshMaterial.DisableKeyword("_ALPHAPREMULTIPLY_ON"); */ m_InteractableHoverMeshMaterial.SetColor("_Color", new Color(0.0f, 0.0f, 1.0f, 0.6f)); }
@adhochero6619
@adhochero6619 4 жыл бұрын
@@silwerifpv8395 yes this is an issue on quest if you run the game it just not there no sockets whatsoever
@kennl66
@kennl66 4 жыл бұрын
@@silwerifpv8395 Thank you so much, this fixed the issue with XR Socket Interactable not working with URP :)
@renmiao296
@renmiao296 4 жыл бұрын
I also found this issue on Oculus Quest. Thanks a ton for finding the bug and the fix! I was about to remove URP from my project but with this fix I will continue with URP! Also I am not sure if we need to comment out those m_InteractableHoverMeshMaterial setters (between /* and */). I left them in, only changed var m_InteractableHoverMeshMaterial = new Material(Shader.Find("Standard")); => var m_InteractableHoverMeshMaterial = new Material(Shader.Find("Universal Render Pipeline/Lit"));. Apparently Unity team forgot to change this line of code (still trying to find Standard shader). With this one line code change Socket Interactor works as expected on Oculus quest.
@TheRedMC
@TheRedMC 4 жыл бұрын
@@silwerifpv8395 Thanks for finding this fix, dude!
@MichaelSchubertPhoto
@MichaelSchubertPhoto 4 жыл бұрын
Hey Valem really enjoy your tutorial. One question considering Socket Snap Zones in XR. Is there a way that I restrict my snapping zone? So my Gun has a specific Snap zone that no other object can snap to. E.G. via a Tag. So only a Gun with a "Gun Tag" and the Snap zone with the Tag "Gun Snap" can work/snap togehter? Would be nice to have this additional info.
@snufkrill
@snufkrill 3 жыл бұрын
A year late but in the xr socket interactor theres a tab that says interaction layer mask, set it to the layer u want and only objects within that layer can snap into it.
@meeperhere
@meeperhere 4 жыл бұрын
Valem: only uses box colliders and sphere colliders Mesh Collider: Am i a joke to you?
@PhantomWolf93
@PhantomWolf93 4 жыл бұрын
The Mesh Collider is more accurate when it comes to establishing collisions, but on the other hand it can give problems and inaccuracies when Unity has to calculate its physics. Whenever you can, use a box collider.
@A_C_007
@A_C_007 4 жыл бұрын
@@PhantomWolf93 I feel like whenever I have a problem with collisions being detected it is because I'm using a mesh collider, way less problems with the other types. Idk what the problem is.
@meeperhere
@meeperhere 3 жыл бұрын
A Convex Mesh Collider Will Work Though
@stevencraft7144
@stevencraft7144 3 жыл бұрын
It wasn't entirely clear to me what the follow math was doing, but to me, if you want something which basically follows your position and direction you are facing, and offsets but only taking into account Y rotation, I'd do something like: transform.rotation = Quaternion.Euler(0f, target.transform.rotation.eulerAngles.y, 0f); Matrix4x4 m = Matrix4x4.TRS(target.transform.position, transform.rotation, target.transform.localScale); transform.position = m.MultiplyPoint(offset); This seemed to work for me (it gave me inventory slots which were always below my head, around my waist, on the left and right.
@Dunzz100
@Dunzz100 4 жыл бұрын
Gracias c: tus videos son de mucha ayuda.
@sambrown2427
@sambrown2427 4 жыл бұрын
Thanks again for the tutorials. I would love to learn how to make the snapzones not scoop up items I pass by. I only want items I place in them via hover to get grabbed. I've tried some solutions with no success yet.
@adgjl822
@adgjl822 4 жыл бұрын
Can you do a video like "how to make a body in VR" but with Unity XR now?
@DodgeThePie
@DodgeThePie 4 жыл бұрын
its the exact same
@filipbursik9635
@filipbursik9635 3 жыл бұрын
That's great, nice tutorial!
@austinheydari1813
@austinheydari1813 3 жыл бұрын
keep up the good work ! thx for the tutorial series 👍🙂🙂
@doriondouglas6176
@doriondouglas6176 4 жыл бұрын
How do you make it so only one specific object can be put into a drop zone? Like with the hat, you could put anything on your head. I wanma make a key system but I dont want a gun in there. I guess I could just use a function that checks if its that exact object, but you will be able to put anything in there.
@Mtech7752
@Mtech7752 4 жыл бұрын
I guess you can just play with the layers. Look at the "XR Socket Interactor" component of your DropZone. You can chose the layer it is interacting with.
@Mtech7752
@Mtech7752 4 жыл бұрын
Okay I just did it. Follow my steps. Lets say I want to make a holster for my Lightsaber. And the light saber will be the only thing I can attach to it. 1) Create a dropzone like in the video. 2) Create a layer called "Light Saber Holster". 3) In the "XR Sockets Interactor" component of your dropzone, there is a line called "Interaction Layer Mask" wich is set to "everything". Put it to "Light Saber Holster" only. 4) Now look at your Light Saber. It has a component called "XR Grab Interactable". There is the same parameter called "Interaction Layer Mask". It is set to "everything". You will notice you can attach your LightSaber to your Holster just like that. But, we dont want any other object to be able to attach to that holster. Here is the trick. You have to change the "interaction layer mask" of every other object to uncheck the layer "Light Saber Holster" that we created. It is a bit long, but in the end its very effective. Because you dont have to change the layer of any of your objects, just the layer mask. If not, you wouldnt be able to grab them anymore. Tell me if you have a problem.
@garlicsuter
@garlicsuter 4 жыл бұрын
@@Mtech7752 I'm trying the route of a custom function so I can just check the tag of the object being held in the snap zone, but I can't get it to work, it just says NOT A FOX everytime even if it IS tagged as "fox": public void IsItAFox(Collider other) { if (other.tag == "fox") { Debug.Log("Yes, it's a fox hovering"); } else { Debug.Log("NOT A FOX HOVERING"); }
@doriondouglas6176
@doriondouglas6176 Жыл бұрын
@@Mtech7752 hey just found this comment 2 years later. I appreciate you going through and doing it (youtube never gave me a notifcation so i never knew! haha) but thank you for going through the effort, it is much appreciated.
@MrRansuil
@MrRansuil 3 жыл бұрын
Lol, I had a cool bug where the door and drawer from the previous tutorial are grabbables, and so when I opened the drawer it would collide with the inventory dropzone that was following me around and completely break the physics!
@gamerpros413
@gamerpros413 3 жыл бұрын
Did you fix it? I have the same problem.
@MouiTV
@MouiTV 4 жыл бұрын
Great videos! It would be great if you could make a video showing how to replace the hands in steamVR into custom ones, there is very little information on how to do this and seems quite difficult!
@devincollins4804
@devincollins4804 4 жыл бұрын
This is great! I always check my feed for when you release new videos! Is there a way to connect this snap zone functionality to a trigger? Say, inserting a card to open a door?
@borkly7926
@borkly7926 4 жыл бұрын
Can you teach climbing next? Great vid btw!
@sauravshrestha1890
@sauravshrestha1890 2 жыл бұрын
This is awesome!!
@AlexBrigham
@AlexBrigham 4 жыл бұрын
Hey Valem, thank you for all of the work you've done on this series. I used to make GearVR games, and took a few years off. Now getting into Quest development with the help of your tutorials. I was wondering if we could see how to make functions that respond to the Touch Triggers being held down. Like a gun that charges while held down, and shoots on release. It doesn't seem like there is any equivalent to "GetButtonDown(0)" for the touch controllers. Thanks again!
@spidernh
@spidernh 4 жыл бұрын
Yeah I wish you could just do something like "Input.GetAxis("LeftTouchControllerTrigger");" I just had to make my own input manager and get the variables that has for each input from other scripts.
@JackDontLie
@JackDontLie 4 жыл бұрын
Thanks valem! :)
@ndonkey
@ndonkey 4 жыл бұрын
Hey I'm having a bit of an issue. On your code when i walk by the draws the the draw and door get sucked up into the inventory slots. I have tried making a couple of changes but seem to make it all work or all break :D Is there anyway to set it so only certain layers can use the inventory or the object has to be held in the hand and dropped before being added to the drop zone?
@rikusoulz
@rikusoulz 4 жыл бұрын
Did you manage to solve it? I'm using the Interaction Layer mask to do it but you have to do it on every grabbable item
@ndonkey
@ndonkey 4 жыл бұрын
@@rikusoulz I some what just got around it. From memory I put the inventory areas into a new layer and allowed them to interact with standard grab items but not the doors, draws, levers, etc. It worked for what I wanted and it meant nothing else needed changing.
@adhochero6619
@adhochero6619 4 жыл бұрын
Hi this tutorial is great and everything working when testing in unity though the link. but when i build and run it to my quest headset, the socket stuff is just gone it no visible socket zone on hover no predetermined object in the slot nothing. has anyone else had this problem. everything else works, even the climbing, just not the sockets.
@philipp282
@philipp282 4 жыл бұрын
I have the same problem. Did you find a way to fix this?
@jacobfoster9358
@jacobfoster9358 4 жыл бұрын
How about a tutorial on how to make an object grabable with both hands at once?
@adhochero6619
@adhochero6619 4 жыл бұрын
this is what i need. i have already tested it with the OVR stuff i have a working two hand rifle. but i just dont know how to use two hand holds with the XR toolkit.
@autumn_id
@autumn_id 4 жыл бұрын
@@adhochero6619 Hey, I just found exactly what you were looking for. There are three videos that can help you out with doing two handed weapons / objects. Check them out! Here's the link on the first video, I hope it will help kzbin.info/www/bejne/f4mVdoh3mNSWpa8
@mario123mario123
@mario123mario123 3 жыл бұрын
He made one :) Part 10 ;] kzbin.info/www/bejne/f5aTXqKBg5h_p5I
@Zyymk0
@Zyymk0 4 жыл бұрын
Keep it up 😛😇
@Frenoir
@Frenoir 2 жыл бұрын
do you have a video for OVR and oculus quest 2 not using XR interaction toolkit
@wrath6692
@wrath6692 4 жыл бұрын
Nice thank you for the tutorial c:
@iuel42
@iuel42 3 жыл бұрын
Valem I have a problem - When I use the socket interactor with an object that has the offset interactable instead of the standard one, the attach transform doesn't work. Is there any workaround for this? Thank you in advance if you reply.
@productreviews2222
@productreviews2222 3 жыл бұрын
I am having the same issue, it grabs the object but won’t let me set the location
@kortalian
@kortalian 2 жыл бұрын
Same issue here. Did you ever figure out how to use an offset grab with the socket?
@blissofkundalini
@blissofkundalini 4 жыл бұрын
Another mind-blow! Haha!
@piotrt.3652
@piotrt.3652 4 жыл бұрын
Hello, Valem thanks for this amazing series! I have one question maybe you know by any chance how to programmatically force interactor (hand) to put some interactable (let say ligthsaber) in hand and then also programmatically remove it from hand (direct interactor)?
@eliassillen6107
@eliassillen6107 4 жыл бұрын
Next tutorial idea how to make a sword attack an enemy or something like that
@spidernh
@spidernh 4 жыл бұрын
That's just normal unity stuff, nothing specific to VR really. Except for that you're experiencing it in VR. Just take a collider and when it touches the enemy make the health go down.
@kennl66
@kennl66 4 жыл бұрын
Is the XR Socket Interactor broken in Unity 2019.4.1f1? Mine is not grabbing anything i put in the sphere, it just falls through. I have a sphere collider set to trigger and added the XRSocket interactor but it's not working. (FIXED) read SilweriFPV comment here, has a fix for the XR Socket Interactable not working with URP. I just tested it and now works on the Quest.
@polar1991
@polar1991 4 жыл бұрын
Do you have any experience with unreal engine? If you do can you make a series on it?
@bones99999
@bones99999 4 жыл бұрын
Great Tutorial. Can you snap multiple objects to the one point if they are different heights?
@TimT26
@TimT26 4 жыл бұрын
Please someone help me! I can drop object in mu dropzone, but I can't take them out of the dropzone. Can somebody help me?
@ValemVR
@ValemVR 4 жыл бұрын
hi Tim, do you have an error showing in the console ? :)
@TimT26
@TimT26 4 жыл бұрын
Valem Hi! No, I don’t have an error. It’s like when the object (Unity cube) is in the drop zone (sphere), it seems like they just don’t collide. I’ve done just as you did in your video. I’ve checked the collission matrix, but there is everything is normal there
@doriondouglas6176
@doriondouglas6176 4 жыл бұрын
@@TimT26 have you checked is trigger on the sphere collider? As in the drop zone collider?
@andra9812
@andra9812 3 жыл бұрын
@@TimT26 have you fixed it ? I have the same problem
@Duckamoly
@Duckamoly 4 жыл бұрын
Dani *uses your tutorial* his subscribers *SUBS TO VALEM OUR AMAZING VR LORD*
@rcalastro0
@rcalastro0 4 жыл бұрын
Is there any easy way to resize the object inside the socket without having to extend the XR Socket Interactor? I tried to resize the "Attach Transform" scale, but it didnt work. Looks like the attach transform is used only to get the position and rotation. Thanks in advance! Valem your videos videos are awesome!
@JoseDaniel_Acosta
@JoseDaniel_Acosta 3 жыл бұрын
THANKS! :D
@ellacouch8723
@ellacouch8723 4 жыл бұрын
Can you plz make a video about locks and keys and maybe number padlocks?
@themirlabs
@themirlabs 3 жыл бұрын
Would it not make it easier to child the obj to the head with the offset?
@nikolatotuhov
@nikolatotuhov 4 жыл бұрын
Hey is it possible to make the dropzone look like the object which needs to be grabbed?
@niklashilger9172
@niklashilger9172 4 жыл бұрын
What i have to do to add in the "FollowToTheSide" Script, that i can adjust the rotation of the Drop Zone?
@sn00ltheog45
@sn00ltheog45 4 жыл бұрын
Hey I was just wondering if there was a better way to track grabbed objects as I like the physics collisions of the velocity tracked movement type but I don't like the jittering when moving whit continuous. Is there a better way of doing it?
@rikusoulz
@rikusoulz 4 жыл бұрын
Very nice job! Just one question, just noticed that if I have the two inventorys (left and right) when I continuous turn, I see like with less fps and is not fluent, not SMOOTH and If I disable the two inventorys changes and has a smooth turning move. Any way to solve this? I really want to have inventory and a normal turn, not stuttered and the only hint I have investigating is that is caused by the "Follow To The Side" script, that causes the turn to be less smooth
@francescomaddaloni9217
@francescomaddaloni9217 3 жыл бұрын
any idea how to do it with the standard oculus integration?
@gabrielcharlessanchez6729
@gabrielcharlessanchez6729 9 ай бұрын
Can I apply this in 3d not vr?
@amadra826
@amadra826 4 жыл бұрын
Imagine making an inventory out of this
@nepal4190
@nepal4190 4 жыл бұрын
hey, do you know how to make a working spin the wheel in vr?
@grandobsidian
@grandobsidian 3 жыл бұрын
ive spent about two hours trying to replicate this and I cant actually get anything to snap into the socket or even seem to register a collision
@n.vano.7529
@n.vano.7529 4 жыл бұрын
Merci pour tes vidéos que je découvre en ce moment, dommage qu'elles ne soit pas en français 😉 signé : un camarade de Bxl ✌🔥!!!
@devariiii
@devariiii 4 жыл бұрын
Is anyone else getting an InvalidOperationException: Collection was modified; enumeration operation may not execute error whenever they put something inside of an XR Socket Interactor?
@mrslake7096
@mrslake7096 4 жыл бұрын
Thx
@athir3324
@athir3324 2 жыл бұрын
Hi . I follow all steps but still the snap not working for me
@chowwill9828
@chowwill9828 3 жыл бұрын
Why is my snapzone can sometimes put the things in, sometimes not??
@Ss-kk4ep
@Ss-kk4ep 4 жыл бұрын
My object enters the ball but when I want to take it out it stays there it does not connect to me at all does anyone know what the reason is?
@andra9812
@andra9812 3 жыл бұрын
I was searching for this comment cuz i have the same problem. Any solutions ?
@mohammadrazakhan3852
@mohammadrazakhan3852 3 жыл бұрын
How to make sound when the controller hits any object ? Can any one help me please ?
@heldoct6154
@heldoct6154 4 жыл бұрын
Can u make VR android with controller? Not use oculus but other controller??
@hamzamellahi3649
@hamzamellahi3649 4 жыл бұрын
where can i find these assets?
@emiltoczyski260
@emiltoczyski260 4 жыл бұрын
The socket interactor doesn't work when you build the game ):
@nace6849
@nace6849 4 жыл бұрын
Hey valem, maybe you know the KZbinr Dani (he has 1 mill subs) and he used your tutorial lol
@vikramsindhu5901
@vikramsindhu5901 2 жыл бұрын
I am just gonna say this You should do udemy course with the latest content and a project within it that'd be great
@smarter4645
@smarter4645 4 жыл бұрын
Regarding the script for the movement of inventory slots with the character. If u want it to follow in the same manner as "CapsuleFollowHeadset" from previous tutorial, replace the FixedUpdate with this: void FixedUpdate() { transform.position = characterTransform.TransformPoint(character.center); transform.eulerAngles = new Vector3(0, VRCamera.eulerAngles.y, 0); } i did not include the offset because I just need this for inventory slots around the belt of the player, for me orienting the gameobject is enough since I track the height. I placed three sphere objects with the socket component under an empty game object that has the script with the code above. Hope it helps. Btw, if anyone knows how to make the whole character not go through walls please let me know, the code from the tutorial series did not work for me.
@Corysia
@Corysia 4 жыл бұрын
Yay!
@meeperhere
@meeperhere 3 жыл бұрын
the objects fly away
@aminer3v695
@aminer3v695 4 жыл бұрын
Are you french ?
@Doggie544
@Doggie544 Жыл бұрын
If this works and don’t waste 20 minutes of my time you a big saver❤
@ValemVR
@ValemVR Жыл бұрын
so whathappened ? :D
@Doggie544
@Doggie544 Жыл бұрын
@@ValemVR idk lol
@pizzaguy6099
@pizzaguy6099 4 жыл бұрын
Am I able to sell a game with your source code
@big_ell123
@big_ell123 3 жыл бұрын
None of these tutorials don’t work for me
@lukenowlandfilms
@lukenowlandfilms 4 жыл бұрын
Is Unity paying you? Unity should pay you.
@spidernh
@spidernh 4 жыл бұрын
why
Introduction to VR in Unity - PART 9 : CLIMBING
11:15
Valem
Рет қаралды 43 М.
I turned my house into a VR Game
8:02
Valem
Рет қаралды 1,2 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Making a Game About Weak Points
21:27
Emis
Рет қаралды 368 М.
Complete VR Body Setup - Arms and Legs IK with Hand Animation
17:36
Valem Tutorials
Рет қаралды 71 М.
Why The Longing Takes Four Hundred Days to Play
20:45
Adam Millard - The Architect of Games
Рет қаралды 7 МЛН
Why Is It Bad That My Game Looks Good?
16:40
Deynum Studio
Рет қаралды 373 М.
Unity VR Game Basics - PART 8 - Socket Interactor
7:34
Fist Full of Shrimp
Рет қаралды 10 М.
How to Slice in VR - Unity XR Tutorial
17:45
Valem Tutorials
Рет қаралды 28 М.
Hand Tracking Teleportation - Unity XR Toolkit Tutorial
14:54
Valem Tutorials
Рет қаралды 8 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 760 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 462 М.