No video

How to use VR Sockets (and XR Interaction Toolkit) in Unity 2021.2

  Рет қаралды 25,586

Justin P Barnett

Justin P Barnett

Күн бұрын

Пікірлер: 107
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Download the Project (for FREE): www.vrcreators.io/codedownloads
@tatepayton7368
@tatepayton7368 2 жыл бұрын
This is just what I was waiting for! A simple way to make things like backpacks and stuff with sockets. Thank you so much for helping out the VR community!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
You're so welcome!
@FusedVR
@FusedVR 2 жыл бұрын
Super comprehensive. Very nicely done!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Thanks!!
@tientam779
@tientam779 2 жыл бұрын
Once agin, great and simple to understand tutorial. I like that you're always checking up on XR toolkit from Unity and making new tutorials about it, allows anyone new to just jump right in and get started with those tool!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Glad to help!
@Ollie_sm
@Ollie_sm 2 жыл бұрын
could you do a tutorial on how to make it possible to climb and glide and even an accurate gliding mode where you can steer up and down using your hands
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Ooo that’s a cool idea! I’ll add that to my list!
@Ollie_sm
@Ollie_sm 2 жыл бұрын
@@JustinPBarnett thank you so much!
@Ollie_sm
@Ollie_sm 2 жыл бұрын
@@JustinPBarnett mechanics similar to this would be great kzbin.info/www/bejne/oHbMfJVoYqmXerM much better than gliding in most vr games
@infectedgoat99
@infectedgoat99 2 жыл бұрын
How did you figure all this out on your own? Incredible video, super helpful. ALSO for anyone struggling with getting the hammer to face the right direction when holding, make sure in the XR Grab Interactable script that you drag your empty game object "Attach Point" onto the "Attach Transform" otherwise the object wont use your attach points!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Lots of testing and just playing around in Unity 😜 and thanks for the tip!
@V-ROCstudios
@V-ROCstudios 2 жыл бұрын
Thanks. I kept thinking I needed to rotate a component.
@k1ng401
@k1ng401 2 жыл бұрын
haha just worked this out myself and then thought "someone else must have had this problem..."
@tommedenney
@tommedenney Жыл бұрын
Thank you soooo much omg tried to figure this out for an hour and a half before coming here
@thaFoxy
@thaFoxy 2 жыл бұрын
great Patreon! it has everything I needed.
@HenshinAsset
@HenshinAsset 2 жыл бұрын
Thank god you did this tutorial. I would have problems this Sunday 😆
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
You’re welcome!
@shayaltshue1791
@shayaltshue1791 2 жыл бұрын
Insanely useful tutorial. Thanks Justin!!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
You’re welcome!
@4per8
@4per8 Жыл бұрын
immana use this for a debug menu in the game im working on, might be cool
@catalinpop342
@catalinpop342 2 жыл бұрын
The timing on this video couldn't have been better. Ran into the missing XR Interaction Toolkit issue yesterday when I updated to 2021.2.6f1 and today I decided to check out my go-to Unity VR resource on KZbin...and what do you know? :)) Massive thanks for all the content, would take me forever to figure this stuff out on my own.
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Ayyy you’re so welcome!
@SimpleDays101
@SimpleDays101 2 жыл бұрын
Once again, I must proclaim that you are, in fact, the MVP. Thanks for the great tutorials!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Awe thanks so much!
@HenshinAsset
@HenshinAsset 2 жыл бұрын
OMG, can't believe they changed it all again 😫
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Right?!?!
@tylerjones9197
@tylerjones9197 2 жыл бұрын
Heads up, Toolkit is spelled wrong in your title. It says tookit. Great tutorial keep em up!!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Holy cow, totally missed that! Thanks!
@bones99999
@bones99999 2 жыл бұрын
Very nice tutorial. Thanks. My new favorite channel. Could you do a tutorial on Hand interaction with colliders on say a desk or wall? Specifically, where if you push the controller through the desk, that the hand stays on the desk until you bring the controller back to the hand position and it will track with the controller again. Or is this built-in to the tool kit? I know some VR interaction tool kits have this feature.
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
It's not built into the toolkit, but I have made a video about physics hands! Check it out: kzbin.info/www/bejne/iKiqeqyIrpJ_qdU
@bones99999
@bones99999 2 жыл бұрын
@@JustinPBarnett cheers. I saw that after I wrote the message. Thanks
@_Garm_
@_Garm_ 2 жыл бұрын
Hi Justin, great tutorial! would you be able to show how to do power cables with the Obi Rope addon like plug in and un plug :)
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
That’d be cool! I haven’t used it but I’ll look into it
@Calactic
@Calactic 2 жыл бұрын
Thanks for this, helped a tonne. I'm just wondering, how would you go about making items being able to stack up on each other? Our game is a survival/horror game and we want players able to put more than one of the same item into a hotbar, which is a sphere socket interactor. Our game takes heavy inspiration from "A Township Tale" if you're familiar.
@firizz
@firizz Жыл бұрын
have you found the answer? plese let me know if you do
@BlackDev
@BlackDev 2 жыл бұрын
I love your vids self taught inspiring game dev have been binge watching your vid and using them as projects but i cant figure out where im going wroong here my line visiuals arent tracking they just go up and down
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Thanks! Join the discord and we can help you out!
@cryptopedia7257
@cryptopedia7257 2 жыл бұрын
hey justin really love the conent. can you make a video on unity vs unreal engine 5 for vr development !!!!!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Yea! I actually dabbled around in unreal for a bit before coming over to unity. I talked about it a bit in my “What you need to start VR” video
@Riprog
@Riprog 2 жыл бұрын
Hey Justin! Love your content, keep it up! I have an issue with using XR Socket Interactors in multiplayer applications using Photon (PUN 2), so far I've gotten no response on the Unity forums. The problem I face is that if a player puts an object in a socket and then grabs it again, the item remains in the socket for other players (not seeing that a player has a grabable in hand). The item has a photon view component on it and also a photon rigidbody view component, I suppose you need to add some component to the socket interactor? Thanks in advance!
@user-yn1sy9bt4w
@user-yn1sy9bt4w 2 жыл бұрын
I have the same problem, just yesterday I saw your post on the Unity forum :). Justin, if you can give any advice would be very grateful too!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
So my initial guess is that is has something to do with parenting the object. Maybe try adding a script to have it follow the socket attach point every frame instead of parenting it. Just a guess though.
@petitwhito3196
@petitwhito3196 2 жыл бұрын
Hi ! I have the same issue, have you found the solution to the problem ?
@Jason-eo7xo
@Jason-eo7xo 2 жыл бұрын
so awesome!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Thanks!
@torstenknodt6866
@torstenknodt6866 10 ай бұрын
Great video, thanks! Is there a way to check dynamically whether a socket interactable could really be dropped on a socket interactor or there is some use-case specific condition which does not allow it?
@kathy02158
@kathy02158 Жыл бұрын
who can tell me if i want use xr sockets apply in slot and become 2d image ,how should i do?
@gnomge
@gnomge 2 жыл бұрын
ayo hold on, letss goo, exactly what i needed. btw i need to add a simple bean to act as the character, like follow the xr rig, cuz when i put it under the xr rig it doesnt follow the camera movement, but when i move it under the camera, it breakdances on me. oh and also how the hell do i stop my character from being able to fly when holding an interactable ways to recreate: create basic xr rig (action based) create an interactable, hold the interactable under the player.
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
You can checkout my VR movement video for getting the collider to follow your camera. And in order to prevent held things from interacting you should set them to an “interactable” layer and set the player to a “player” layer and then in your project settings > physics make sure in the grid that the checkbox between the layers is unchecked so they don’t interact
@gnomge
@gnomge 2 жыл бұрын
@@JustinPBarnett thanks a lot! also does ur video include adding a visual character to the xr rig? cuz my project is a vr shooter and it needs the character to not only to have a body, but the body to have a collider. so how the hell do i set up the character model (i only need it to be a bean) to the xr rig?
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
@@gnomge I do have another video about that! Inverse kinematics
@dracula9202
@dracula9202 2 жыл бұрын
Impressive! Thanks for sharing! I wonder if there is a workaround so that only objects that are being grabbed atm can be selected in the socket. I already tried to play around with some things in the public override bool CanSelect(XRBaseInteractable interactable) interactable.isSelected.. but nothing seems to work xD Thanks in advance if anyone has a hint^^
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
I was actually playing around with that today and couldn’t find a solution for that either 🤔
@Acilianus
@Acilianus 2 жыл бұрын
I know it has been 4 weeks now, but It was tricky and I found a (mostly satisfactory) solution so posting it here for you in case it is still relevant. What I did is I switched the layermask on the interactable when the interactable hovers over the socket (OnHoverEnter interaction event) to a layer which can not interact with the socket, on the condition that an XRDirectInteractor is not currently selecting the interactable. The tricky part here is that you have to switch back to the originla layermask. First my intuition was to do it on the OnHoverExit event, but since the interactable was moved to another interaction layer, the socket was not detecting events on it anymore... So instead I implemented a coroutine which resets the layer mask on the interactable if the interactable is selected, or moves away a certain distance from the socket. This mostly works well, the only hiccup is that when the (ungrabbed) interactable falls into the socket, it still stops for a second before falling through it. However, the socket will not pick up the interactable even if the interactor rests right on top of it. Here is the code for reference (the disableInteractor method is bound to the OnHoverEnter event of the socket. Note that interaction layer numbering starts from 1 not 0. Also note that when the interactable hovers above the socket it already counts as selected. ): // Disable the interactable if it is not grabbed when placed into the socket (e.g. it conincidentally falls/bumps in it) public void disableInteractor( HoverEnterEventArgs eventargs ) { XRGrabInteractable interactable = (XRGrabInteractable) eventargs.interactableObject; if ( interactable.interactorsSelecting[0].GetType() != typeof( XRDirectInteractor ) ) { //interactable.GetComponent( ).enabled = false; interactable.interactionLayers = 2; StartCoroutine( reEnableInteractor( interactable, interactable.interactorsSelecting[0] ) ); }; } // Reenable the interactor after an accidental fall/bump into the socket private IEnumerator reEnableInteractor( XRGrabInteractable interactable, IXRSelectInteractor interactor ) { while ( Vector3.Distance( interactable.gameObject.transform.position, interactor.transform.position ) < 0.2f ) { if ( interactable.isSelected && interactable.interactorsSelecting[0].GetType( ) == typeof( XRBaseInteractor ) ) { interactable.interactionLayers = 1; break; } else { yield return new WaitForSeconds( 0.1f ); } } interactable.interactionLayers = 1; } Hope this might help some people.
@ivani5543
@ivani5543 Жыл бұрын
Thank you for your wonderful tutorial. If using xrit to splice objects, similar to LEGO, how can they be connected one by one? Do you have any good suggestions?
@wisdomkhan
@wisdomkhan 7 ай бұрын
Any idea how to make a Lego VR game?
@jaimejia86
@jaimejia86 2 жыл бұрын
Hi Justin, Im using the Oculus interaction (OVR) but i can find any snap or socket script, please help me
@andreramiro732
@andreramiro732 Жыл бұрын
Same problem here. Youve got the solution?
@djmedina50
@djmedina50 Жыл бұрын
Hello Justin, I like so much your videos. I have one question. I've followed your tutorial to try to do an inventory but at the moment I hide de canvas all the items that I have shocked falls down. What can I do to make the Items be hiden with the canvas and showed again. The inventory is a canvas with Slots that can be showed and hided pressing the button X of the left controler in Oculus quest 2. Thanks and best regards.
@k1ng401
@k1ng401 2 жыл бұрын
Did you miss a step? Were you supposed to make the Attach Points selected in the Attach Transform selection? Until I did that, it was ignoring my Attach Points completely and the hammer was facing the wrong way, the shield was being held right in the centre
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Yes I did that!
@k1ng401
@k1ng401 2 жыл бұрын
How do we make the hammer and shield collide with each other when held? or is that not possible. I see they collide with the world and they collide with each other when not held but I can't bang them together while holding them. I don't know if I ever will want to but it might be handy to know
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Change the grab interactable component grab type from instantanious to velocity tracking
@alejandrodelgado74
@alejandrodelgado74 2 жыл бұрын
Awesome thanks so much….. unity should by default setup your scene….
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Yea that'd be nice. There is a VR template, but it's not really that great
@Ctorresification
@Ctorresification Жыл бұрын
Great tutorial! Is there any way to make it so the player has to place the interactable object into the socket? I have a socket attached to my players finger for attaching rings and I can pick up the ring with one hand and put it onto the finger of the other hand just fine, but I can also just move my hand over a ring sitting on a table and it will snap to the socket automatically. I want the player to manually drop the ring onto the finger.
@andreramiro732
@andreramiro732 Жыл бұрын
How can i do this with the Oculus Integration (OVR)?
@k1ng401
@k1ng401 2 жыл бұрын
Only renders in the Left eye. Did I accidently click something I shouldn't have?
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Try going to project settings > OpenXR > and swap render mode to multi-pass
@k1ng401
@k1ng401 2 жыл бұрын
@@JustinPBarnett Yep! That fixed it. NOTE i have both the PC and Android OpenXR setting and first I tried it on the Android part and it made no difference so I did it on the PC setting part and it worked. So basically it's the PC Settings that matter when streaming from the PC to the headset and the Android if you Build and send the file to the headset to play it there? is that correct?
@k1ng401
@k1ng401 2 жыл бұрын
@@JustinPBarnett as a side benefit I now know how to simulate a pirate player character with a patch on his right eye if I ever create a swashbuckling VR game 😁
@1998natan
@1998natan 2 жыл бұрын
Very nice tutorial. But i don't know how to launch my project on quest 2. Do i need to do something special? Cheers
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Like build your project to the quest or just run it in play mode?
@1998natan
@1998natan 2 жыл бұрын
@@JustinPBarnett Thanks for answering! Got help on your discord. I had to disable air link and then plug in cable and enable on quest. 👍💪
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
@@1998natan awesome!!
@kwani_
@kwani_ Жыл бұрын
Everytime i press play my hands are not attached, it just stay where it is and I can't see them, anyone knows how to fix this please ?
@patty__
@patty__ 2 жыл бұрын
hey, great video. just wanted to ask if i should continue with unity 2020 or if you think i should use 2021 instead? i'm only up to importing hands in 2020 so it wouldn't waste much time to start the 2021 version.
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
If you're building a game to release go with the latest 2020.x LTS version, but if you're just learning then I'd recommend using the latest non-beta version! Does that make sense?
@patty__
@patty__ 2 жыл бұрын
@@JustinPBarnett yeah that makes sense, thanks. i do want to make a small first game so i'll stick with 2020, thanks!
@bhargavgaurav9870
@bhargavgaurav9870 Жыл бұрын
Xr toolkit inputfield active perform tha meta quest pro
@thegamingcoder4789
@thegamingcoder4789 2 жыл бұрын
how do you use the socket interactor to trigger code events
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
In the inspector there should be interaction events you can attach scripts to
@trumancoburn3335
@trumancoburn3335 2 жыл бұрын
Hey quick question, is there anyway to get a held input for my joystick? I'm trying to make a sprint system but I cant get an unpressed thing back from it, so I cant make the speed go back to the original when you unpress the joystick.
@trumancoburn3335
@trumancoburn3335 2 жыл бұрын
Found a solution!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
What was your solution?
@Magiak
@Magiak 2 жыл бұрын
Hello Justin. Could you please help me find out why I can see only black screen in my Oculus Quest 2? I step by step followed the first section 'How to set up a VR project in Unity 2021.2'. of video, Then I switched the platform to Android, selected device and pressed 'Build and run'. It created the apk and uploaded it to the quest but only thing I can see on my Oculus is black screen. Could you please help me what to do? I tried older Unity 2019, 2020 and it's OK but I would like to use Unity 2021. Thank you for awesome video!
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Hmmm maybe ask in the Discord. May need some screenshots or more specific details to help fix
@Magiak
@Magiak 2 жыл бұрын
@@JustinPBarnett Do you have any example project in Unity 2021 configured for Oculus Quest I could try to run?
@doktor1350
@doktor1350 2 жыл бұрын
Can I use XR Interaction Toolkit with SteamVR plugin hands?
@christopherarendt3531
@christopherarendt3531 2 жыл бұрын
There is no Default Input Actions under XR Interaction Toolkit Samples
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
It's changed to another name, but still in the same place
@franciscoflor6572
@franciscoflor6572 2 жыл бұрын
I followed all these steps yet interaction toolkit does not come up
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
You typed it in correctly to the package manager?
@OTAKUBLOCKU
@OTAKUBLOCKU 2 жыл бұрын
@@JustinPBarnett Yes even re did it a couple times too. And tried different versions of Unity. How is that possible?
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
@@OTAKUBLOCKU Strange.... does it show up in 2020 for you if you enable pre-release packages?
@OTAKUBLOCKU
@OTAKUBLOCKU 2 жыл бұрын
@@JustinPBarnett yeah that’s what’s so weird about it. I do have an “error refreshing packages and features,see console” in the package manager. In console it says; “Cannot perform upm operation: unable to perform online search:” And “Error searching for packages” My wife is connected though.
@OTAKUBLOCKU
@OTAKUBLOCKU 2 жыл бұрын
@@JustinPBarnett okay I figured it out I needed to create a new rule for my firewall to accept unity updates from internet. Thank you for responding.
@leventebotos6927
@leventebotos6927 2 жыл бұрын
Hi guys! I want to ask that how can i address an xr origin in code? Sorry if it's a stupid question but i can't find a solution on the internet.
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
It's the "XROrigin" class!
@leventebotos6927
@leventebotos6927 2 жыл бұрын
@@JustinPBarnett Hey Justin! Could you explain this please?
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
@@leventebotos6927 join the discord and we can answer more detailed
@hynesie11
@hynesie11 2 жыл бұрын
damn i thought this was gonna be about web sockets :(
@steampunkengi5805
@steampunkengi5805 2 жыл бұрын
How weird; my Socket Interaction's Hover Mesh isn't in a static location, but follows/rotates with the object I want to put in! Even more so, it's not even IN that object, it's some distance away
@JustinPBarnett
@JustinPBarnett 2 жыл бұрын
Very strange. Sometimes socket stuff has a mind of its own
How to Eat in VR using the Unity XR Interaction Toolkit
19:32
Justin P Barnett
Рет қаралды 7 М.
My Game Dev Workflow & Tools in 2024
6:14
JamieDev
Рет қаралды 175 М.
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 24 МЛН
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 16 МЛН
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 14 МЛН
The FASTEST way to PASS SNACKS! #shorts #mingweirocks
00:36
mingweirocks
Рет қаралды 12 МЛН
Hand Tracking with Unity XR Interaction Toolkit
16:30
Valem Tutorials
Рет қаралды 74 М.
VR Interaction Framework With Hands And Controllers | VR Cross Platform !
10:33
The biggest lie in video games
15:18
AIA
Рет қаралды 1,8 МЛН
5 Unity Assets for VR You Need to Know
9:55
Justin P Barnett
Рет қаралды 79 М.
How To Make Your Own Virtual Reality Games With Unity & XR
15:05
Justin P Barnett
Рет қаралды 119 М.
I Spent 100 HOURS Making a Game With NO GAME ENGINE
13:42
Fuelvin
Рет қаралды 339 М.
How to Make a VR Game WITHOUT a VR Headset
18:12
Valem
Рет қаралды 119 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 4,7 МЛН
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 24 МЛН