How to Add Swimming to Your Unity VR Game

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 71

  • @skyreep1
    @skyreep1 2 ปีที่แล้ว +6

    YESYESYES. I’ve been waiting for somebody to do a half decent swimming tutorial for SO long. The internet thanks you.

  • @PurpleLich
    @PurpleLich 2 ปีที่แล้ว +2

    An elegant solution. This was a lot simpler than I expected. I would like to do a variant that let's me fly in VR ... without a whole bunch of flapping. Maybe more like some version of levitation, where I move my hands slowly ...

  • @PremortalVR
    @PremortalVR 2 ปีที่แล้ว +2

    Thanks for making this tutorial Justin! A swimming system is mandatory for any survival game

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Ooo I like your thought process

  • @JustinPBarnett
    @JustinPBarnett  2 ปีที่แล้ว +4

    Download the project here: shop.justinpbarnett.com/products/vr-swimming

  • @GamerReality
    @GamerReality 2 ปีที่แล้ว +1

    Perfect time again! I just finished playing Hubris VR’s demo and the swimming in there is amazing. Entering and exiting the water finally makes me feel like I’m in another reality.

  • @dancinspace
    @dancinspace 2 ปีที่แล้ว

    These was extremely helpful! I didn't need to create a swimming mechanic specifically, but the video did a great job explaining how to integrate XR controls with a custom movement controller. Thanks!

  • @elnurmehdiyev5062
    @elnurmehdiyev5062 2 ปีที่แล้ว

    I did wrong first time creating velocity for controller interaction, changed it to controller itself and it worked perfectly. Big thanks for tutorial!

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Nice work!

    • @elnurmehdiyev5062
      @elnurmehdiyev5062 2 ปีที่แล้ว

      @@JustinPBarnett I have further tuned code a bit adding movement down simulating gravity. Would you make video tutorial on how to add diver model and animate to have his hands also grab things for seabed? This would complete your tutorial and would be very useful to subscribers

  • @waifuink3453
    @waifuink3453 2 ปีที่แล้ว +1

    Woah, I cant wait to try this in the river!

  • @FrankiesPixelDreams
    @FrankiesPixelDreams ปีที่แล้ว

    Nice, i have been trying to implement it with hurricaneVR and it was very easy, and the swiming feels so nice with this solution :]

  • @generichuman_
    @generichuman_ 2 ปีที่แล้ว +1

    Dude! You're a mind reader. I was trying to figure this out last night. I thought it might be as simple as taking the gorilla tag movement and removing the collision check, so that Hooke's Law acts when you're just swinging your arms around, but... no such luck. I tried it, and laughed at my own stupidity. Well, time to find out how it's actually done!

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      No way! Well hope this helps point you in the right direction!

  • @kirak
    @kirak 2 ปีที่แล้ว +1

    What a great tutorial! Thank you, this helped me a lot.

  • @paulpasion-gonzales6534
    @paulpasion-gonzales6534 ปีที่แล้ว

    Very Helpful tutorial, Thanks!

  • @danieloldham3187
    @danieloldham3187 11 หลายเดือนก่อน

    Any suggestions on how to do arm swinging locomotion for Quest with the new XR toolkit? I've used the ElectricNightOwl asset in the past but trying to figure out a solution that doesn't require SteamVR.

  • @Sticks_Dev
    @Sticks_Dev 2 ปีที่แล้ว +1

    Hey JP, are there any upcoming headsets or VR technologies (non-HMD) that you look forward to either playing on / developing for?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      The quest 2 has really cornered the market, so naturally I'm excited for the next iteration of that headset! And once Apple enters the HMD market (suposedly this year?) VR is going to take off like crazy

  • @TheLonelyDeveloper
    @TheLonelyDeveloper ปีที่แล้ว

    Hello Justin. Quick tech question. I am struggling with water in VR a bit, specifically in single pass instanced mode on a Quest 2. In multipass it works fine, but the performance hit is too big. Do you have any suggestions for making realistic looking water in single pass instanced mode? Having the same issue with volumetric clouds, it's pretty annoying... Thanks in advance!

  • @benseo8371
    @benseo8371 2 ปีที่แล้ว

    Thank you for the great tutorial! I'd also love to see you do a swimming tutorial with oculus hand grab interaction as well. That would be awesome:))

    •  2 ปีที่แล้ว

      Did it work for you? With the recent updates I must be doing something wrong, because it doesn´t work

    • @ZerkForReal
      @ZerkForReal 2 ปีที่แล้ว +1

      @ i can help you

  • @alexha6200
    @alexha6200 2 ปีที่แล้ว +1

    Hi thanks for your awesome tutorial, I'm currently create a vr game for oculus quest 2 and I would like to know how I can pause the game with XR when the user removes the HMD or opens Universal Menu.
    I couldn't find any information about this subject. Maybe you could make a video about this subject because your explanation is awesome.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Oh that's a great idea. I'll have to make a tutorial for that

  • @ErebusGraves
    @ErebusGraves 2 ปีที่แล้ว +2

    This Is amazing and I thank you for creating this. I was wondering though, is there a way to only activate it when your player hits an object tagged water? I would love to incorporate it so that I can have a level on both land and sea, however currently its making it so that I can fly above the water. I've been trying by myself for a few hours, but honestly I have no coding experience on my own. Also is there a way to make it work with a player controller instead of a rigidbody? When I added the script to my character with a player controller, it dropped like a brick and wouldn't work so I had to remove the player controller. Is there a way to have two different xr setups as prefabs, then activate the one I want when I touch the water object in the level? I feel like that would work, but I don't know how I would change them out.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +2

      Yea you can definitly do that! I'd add a collider to the swimming area and have an if statement on the swimming script that only activates it if you're within a particular collider!
      As far as the character controller, unfortunately this script won't work with that because the character controller doesn't use the physics system

  • @magnoliablitzball
    @magnoliablitzball 2 ปีที่แล้ว +1

    Hey Justin,
    Can we get a tutorial on weapons shooting and reloading and even a respawn kind of script

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Yes! I need to make that one soon. It's a highly requested video

  • @mau3020
    @mau3020 2 ปีที่แล้ว +1

    Epic, I have to see this

  • @parsec3d
    @parsec3d 2 ปีที่แล้ว

    Would this be doable with hand tracking??

  • @tacticalmythic7945
    @tacticalmythic7945 2 ปีที่แล้ว +1

    No way you making this a tutorial 😁 yay

  •  2 ปีที่แล้ว

    The new Interaction Toolkit has the action maps for each hand separated in None, Interaction and Locomotion, should this affect to hoy you set up the script and the references?

  • @elnurmehdiyev5062
    @elnurmehdiyev5062 2 ปีที่แล้ว

    Quick question. Why after all this operatıons grab function does not work? I have reassigned select and activate, checked all optıons as per standard ınteractıon tutorıals, but still can't swim and grab objects from seabed.

  • @KikitaPedro
    @KikitaPedro 5 หลายเดือนก่อน

    How much would you charge to do a model of a place if I send you a picture?

  • @tacticalmythic7945
    @tacticalmythic7945 2 ปีที่แล้ว +1

    Great video. Is it possible to make a tutorial on jumping while using Xr movement system? I was watching ur old tutorial and when I jump and don’t move it’s fine. The moment I move I stutter when in the air. Tried asking in ur server and no one knew how to fix this :(. Anyway cool mechanic. I might add this to my game. Will probably be on the oculus store within 6 months - wish me luck. Would u want to check out my game when I do?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Yea I need to do an updated jump tutorial for rigs with a rigidbody

    • @tacticalmythic7945
      @tacticalmythic7945 2 ปีที่แล้ว

      @@JustinPBarnett that would be great!

  • @monkrillavr
    @monkrillavr 2 ปีที่แล้ว +1

    I don't get the purple text that you do when I type the SerialField and UnityEngine and I don't even get the InputActionReference red. Are you using Visual Studio cus that's what I use.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      I'm using JetBrains Rider, so the coloring may be different

    • @monkrillavr
      @monkrillavr 2 ปีที่แล้ว

      @@JustinPBarnett That's the only diffrent right?

  • @game.burger
    @game.burger ปีที่แล้ว +2

    Does anyone know why it doesnt work when i build it on my quest?

  • @justraindrop1524
    @justraindrop1524 2 ปีที่แล้ว

    What if you only want to swim in a certain area?

  • @rafaaaaa478
    @rafaaaaa478 2 ปีที่แล้ว

    How do I change the grip button to be the trigger button?

  • @ashdotpy
    @ashdotpy 2 ปีที่แล้ว

    Any solution for using Oculus plugin and the velocity? When I try to use OpenXR, I get HMD issues in my eyes (left eye is grey, right eye doesn't render) but with the Oculus plugin, I cannot get the Velocity to work

    • @ashdotpy
      @ashdotpy 2 ปีที่แล้ว

      I take that back, I got the velocity working with oculus plugin but just having trouble figuring out how to work when only entering water

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Glad you got it working! You put a trigger box around the area where the water is and have the player checking if they're within that box

  • @kimberlylegg2165
    @kimberlylegg2165 ปีที่แล้ว

    I beg of you to make a flying tutorial like bird flying where you have to flap your arms I order to move and maybe even glideing

  • @monkeebomb2971
    @monkeebomb2971 2 ปีที่แล้ว +1

    How make online server pls

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Planning on making a multiplayer tutorial soon!

  • @kilupvr9083
    @kilupvr9083 2 ปีที่แล้ว

    do you have a tutorial for making a vr game multiplayer

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Coming in the next few weeks!

    • @kilupvr9083
      @kilupvr9083 2 ปีที่แล้ว

      @@JustinPBarnett alright thanks

  • @gikisTSB
    @gikisTSB 2 ปีที่แล้ว +2

    Hello there, Justin!
    What VR headset are you using to develop in Unity? We're a bunch of friends who somehow managed to wiin a few gamejams on sandbox.game platform and now we consider diving into VR space as it is the future (utopian or dystopian, doesn't matter).
    I've tried quest 2, but the FOV is just terrible.

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว +1

      Usually I use the Quest 2 because it has the most marketshare, but I also highly recommend the valve index!

    • @gikisTSB
      @gikisTSB 2 ปีที่แล้ว

      @@JustinPBarnett Thank you so much! We're going with the valve index and we'll follow your every video! You're our sacred mentor from now on! Good luck. Your channel will keep growing if you keep putting the effort. People are just entering the Vr...Give it 10 years for 60% of population swimming inside the ocean of infinite dreams.

    • @Renatim2009
      @Renatim2009 2 ปีที่แล้ว

      @@gikisTSB go with Quest 2, since Valve Index is tethered to.a powerful PC, and it is very high cost. Quest 2 is cheaper, untethered and you can do the tutorials without any flaw and you also have more content in TH-cam regards Quest 2 dev.

    • @gikisTSB
      @gikisTSB 2 ปีที่แล้ว +1

      @@Renatim2009 Hello, Renato. Thank you for your comment.
      In my country Valve Index costs 750 euros and buying new Oculus quest 2 can cost around 600 euros, because I want the elite strap, link cable, extra battery and so on.
      I also have a powerful ryzen rtx 3070 laptop, so I think its not a problem to run a basic development on it.
      Knowing these things, would you still think Quest 2 is way to go?

    • @Renatim2009
      @Renatim2009 2 ปีที่แล้ว

      @@gikisTSB I see. Yeah, in that case, Valve Index is really a good option. :) But not forget that Index needs sensor towers, so you will need some space.

  • @axelsmaxel
    @axelsmaxel 2 ปีที่แล้ว

    How do I setup the velocity on the controllers if I am using the auto hand asset?

    • @JustinPBarnett
      @JustinPBarnett  2 ปีที่แล้ว

      Should be able to do it the same way if Auto Hand doesn't already have a velocity value (which I'm pretty sure it does)

    • @axelsmaxel
      @axelsmaxel 2 ปีที่แล้ว

      @@JustinPBarnett couldnt find one

  • @jonahboos8852
    @jonahboos8852 2 ปีที่แล้ว +1

    First