Unity VR Development for Oculus Quest: Inventory

Поділитися
Вставка
  • Опубліковано 20 сер 2024
  • Accelerate your development process with our new, ready to use VR UI PACKAGE, now on the Unity Asset Store! Link for %10 off: assetstore.uni...
    In this video I will teach you how to create an inventory for your VR application/game in Unity for the Oculus Quest.
    Link for InventoryVR script: www.realary.co...
    COURSE PLAYLIST: • VR Development Full Co...
    Thanks for watching!

КОМЕНТАРІ • 54

  • @thesheepregime8644
    @thesheepregime8644 Рік тому +3

    Thank you for the tutorial, this really helped me, one thing, I have encountered a big..if the object is colliding with two slots at same time, both slot will act as full but only one will get the object, so I had to check count of Child for slot gameobject to reset it null after every frame end

  • @ogr3dblade6
    @ogr3dblade6 3 місяці тому

    best tutorials ive ever found

    • @RealaryVR
      @RealaryVR  3 місяці тому

      Thank you appreciate the kind words!

  • @user-mm5di5xw6t
    @user-mm5di5xw6t 2 роки тому

    This is what i wanted !! Thank you

  • @nishalllstm
    @nishalllstm 2 роки тому

    Thank you so much for these tutorials

  • @jabrailchumakov
    @jabrailchumakov 11 місяців тому +1

    How did you convert 3D object to 2D sprite in this video?

  • @Unmighty1
    @Unmighty1 2 роки тому

    Great video!! Really appreciate it.

  • @v.n.3751
    @v.n.3751 8 місяців тому +1

    is there a way to do this with OpenXR instead of oculus? (using valem tutorials Let's Make a VR game series but I wanted to add an inventory)

  • @olivername
    @olivername 8 днів тому

    would this work for openxr too thanks

  • @jiminusgames8055
    @jiminusgames8055 2 роки тому

    hi, very good work, we must continue to make videos,,, ;)

    • @RealaryVR
      @RealaryVR  2 роки тому +1

      Thank you, yes we should!

  • @aryajoyo3907
    @aryajoyo3907 2 роки тому +2

    For the Inventory VR script on the private void update function for the first if statement what do I change the OVRInput to if I’m using the new XRorigin controller? plsssss helppp

    • @mazentohari5655
      @mazentohari5655 Рік тому

      Have you found the solution?

    • @lefthandedcat8766
      @lefthandedcat8766 Рік тому

      the easiest way would be to make a public XRController in the script and drag your xr controller onto it in the inspector, then make a function like
      public bool IsButtonPressed()
      {
      bool buttonDown;
      lefthandcontroller.inputDevice.IsPressed(InputHelpers.Button.PrimaryButton, out buttonDown);
      return buttonDown;
      }
      that will check for if the button is pressed

    • @lefthandedcat8766
      @lefthandedcat8766 Рік тому

      it should be noted though, that if you do not have the coding knowledge for this part you're going to have a very difficult time when it comes to coding the grab events since he modifies the OVR code for grabbing directly, so you're going to have to make your own system for XR interactions.

  • @scratchbuildermodels254
    @scratchbuildermodels254 Рік тому

    Really helpful, what is needed to use this with Auothands, as I'm getting numerous compile errors?

  • @USERS-WORLD
    @USERS-WORLD Рік тому

    can u do a tutorial on a quest system for vr i have tried looking every where but i cant find a way i aint good at coding so ur help would be nice

  • @lucaspicanco9649
    @lucaspicanco9649 2 роки тому

    How to I make it so, as soon as you start the game all game objects with a “inventory” tag will be in the inventory and make them infinite ( so you can grab and throw as many gameobjects as you want and that gameobject will still be in the inventory?)

  • @prateekmhetar7663
    @prateekmhetar7663 2 роки тому +1

    Great Tutorial
    But a question here can I use this method for other vr devices also or not?
    like for openvr devices

    • @RealaryVR
      @RealaryVR  2 роки тому +1

      Glad you enjoyed it! You can follow the same logic/ideas of the video and make the code equivalent of what I have on your desired platform/headset. It won't work with other devices if you take the same code and copy step by step tho.

  • @Kindsty
    @Kindsty 15 днів тому

    Hey, for me the website doesnt seem to work. Please Let Me Know If Its Just A Me issue

    • @RealaryVR
      @RealaryVR  10 днів тому

      Hi! Our website was down due to some issues. It's back up now 😊

  • @rsrivishwanath6724
    @rsrivishwanath6724 5 місяців тому +1

    i couldn't modify grabbable script do you know why?

    • @singular-lb2hh
      @singular-lb2hh 4 місяці тому

      I have the same problem. In my code editor, there is a message that say "This file is part of the Unity Package Cache. Any changes made will be lost". If anyone knows how to modify it, we will apreciate it.

    • @rsrivishwanath6724
      @rsrivishwanath6724 4 місяці тому

      @@singular-lb2hh sad part is you can't modify it you can only inherit from it.

    • @rsrivishwanath6724
      @rsrivishwanath6724 4 місяці тому

      @@singular-lb2hh in other words you have to come with different solution

  • @ANUBIS_game_dev
    @ANUBIS_game_dev 2 роки тому

    thanks dear you place put link for item and slot script

  • @diegoserrano7170
    @diegoserrano7170 2 роки тому

    Could you explain how grab objects, like a gun, with hands control?

    • @RealaryVR
      @RealaryVR  2 роки тому

      Hi Diego! Go to the playlist from the link in the description. There are videos about hands, grabbing, distance grabbing, and also a gun tutorial.

  • @SmartGooseInteractive
    @SmartGooseInteractive 7 місяців тому

    Great Tut! How would this work with hands?

  • @oscarliemena2025
    @oscarliemena2025 2 роки тому +1

    Thank you for this tutorial. I managed to get it to work but I ran into a bug that if the grabbed object has a big enough collider it can collide with 2 adjacent slots at the same time which changes the ItemInSlot property for both slots, rendering one of the slots unusable afterwards (since it thinks there's an item in there).
    I wonder what's the best solution to tackle this issue?
    EDIT:
    I solved it by adding tag "Slot" to all of the Slot game objects. Then I wrote this script to detect if an object is colliding with another game object with a "Slot" tag and attached it to all the Item game objects.
    using System.Collections.Generic;
    using UnityEngine;
    public class ColliderList : MonoBehaviour
    {
    [SerializeField]
    protected List m_colliders;
    public List getColliderList
    {
    get { return m_colliders; }
    }
    private void Start()
    {
    m_colliders = new List();
    }
    private void OnTriggerEnter(Collider other)
    {
    GameObject obj = other.gameObject;
    if (obj.tag == "Slot") m_colliders.Add(obj);
    }
    private void OnTriggerExit(Collider other)
    {
    GameObject obj = other.gameObject;
    if (obj.tag == "Slot") m_colliders.Remove(obj);
    }
    }
    Finally, inside the OnTriggerStay function for the Slot script I've added an additional check:
    if (obj.GetComponent().getColliderList.Count > 1) return;
    This makes sure if you release a grabbed Item while it is colliding with more than 1 Slot, the Item will not get inserted.
    I've also run into another bug:
    If your Slot is colliding with an Item while you're releasing another Item currently being grabbed that isn't colliding with any Slot(s), the collided Item will get inserted into the Slot. To fix this, I added the followings to the Slot script:
    bool lastFrameGrabbed;
    void Start()
    {
    ...
    lastFrameGrabbed = false;
    }
    private void OnTriggerStay(Collider other)
    {
    ...
    if (OVRInput.GetUp(OVRInput.Button.SecondaryHandTrigger) && lastFrameGrabbed == true)
    {
    InsertItem(obj);
    }
    lastFrameGrabbed = obj.GetComponent().isGrabbed;
    }
    The code will check whether the colliding Item was in a state of being grabbed on its very last frame before being released, if it was, then proceed with the insertion.

    • @lucaspicanco9649
      @lucaspicanco9649 2 роки тому +1

      For the Inventory VR script on the private void update function for the first if statement what do I change the OVRInput to if I’m using the new XRorigin controller?

    • @aryajoyo3907
      @aryajoyo3907 2 роки тому

      @@lucaspicanco9649 yahh me too need like that

  • @Thatoompaloompa
    @Thatoompaloompa 2 роки тому

    Is there a way to make this capable with steam vr?

  • @aristotlebuenaventura6566
    @aristotlebuenaventura6566 10 місяців тому

    Hi, why does the code that I typed in GrabBegin disappear when I hit play?

  • @iitzraidersz4529
    @iitzraidersz4529 2 роки тому

    it says can't add script 'Slot1' (also inventory) because the script class cannot be found. Make sure there are no compile errors and that the file name and class name match. How do I fix this?

    • @Wayloz
      @Wayloz 2 роки тому +1

      I'm a bit late but does the script name inside of the IDE, the name before : MonoBehvaiour, match the script name in the editor?

  • @tacticalmythic7945
    @tacticalmythic7945 2 роки тому

    Can you make a tutorial on how to host your own server and join others using VR and how to access a internet browser with this keyboard like UA-cam?

    • @Wayloz
      @Wayloz 2 роки тому +1

      I believe Valem has a tutorial series for VR Multiplayer

    • @tacticalmythic7945
      @tacticalmythic7945 2 роки тому

      @@Wayloz really? Awesome sweet. I am a decent programmer as I know the basic fundamentals from taking C++ classes, just not so much the server data base stuff with multiplayer. I’ll see if he has any vids

    • @Wayloz
      @Wayloz 2 роки тому

      @@tacticalmythic7945 Multiplayer is definitely a huge task in any game, it's exponentially harder than a singleplayer game. Now everything has to be networked reliably, I'm glad you're confident and have experience but personally I'd recommend completing a singleplayer project first to a degree where you don't need to rely on many tutorials. Pretty sure Jason Weimann has a video saying similarly.
      Whichever path you choose to take, goodluck.

  • @simons3943
    @simons3943 Рік тому

    Thanks for this tutorial! I almost got it to work. I can open and close the inventory. drag objects into it, but the problem is i cant get them out anymore. I don't know what went wrong. I've tripple checked the code and everything is exactly the same as with your code. One suspicion I have is that Unity said I had to switch from the standalone Input module to theInput System UI Input Module because the standalone input module uses an old inputManager. Any advice of what needs to be setup differently with this new inputsystem? Please HELP!!

    • @SYBIOTE
      @SYBIOTE Рік тому

      i have the same issue, did you find a fix?

    • @simons3943
      @simons3943 Рік тому

      Hi @sybiote, yes I fixed it. The issue was that I used a different Grabmäler script that in this video there are two different ones one called OVR grabbable and one just called grabbable. I don’t remember which one is the correct one to use. U can also use both haha (guess it’s not very efficient) but i needed to use both as only the grabbable script allows two hand interactions which I needed as well. Hope this helps ;)

    • @SYBIOTE
      @SYBIOTE Рік тому

      @@simons3943 ok thanks a lot

  • @MRElektronka
    @MRElektronka 2 роки тому

    Make tutorial fór crafting unity vr

    • @RealaryVR
      @RealaryVR  2 роки тому

      Hi Matyas, can you explain more what you mean by crafting?

    • @lucaspicanco9649
      @lucaspicanco9649 2 роки тому

      @@RealaryVR I think he means crafting from mimecraft

    • @MRElektronka
      @MRElektronka 2 роки тому

      @@RealaryVR for example, if I put iron and wood in a box and press a button, it will be connected, for example, to a shovel, but made so that everyone can come up with recipes and add