How to Setup XR Toolkit's Action-Based Input in Unity

Sdílet
Vložit
  • čas přidán 28. 08. 2024

Komentáře • 166

  • @Colab-Film
    @Colab-Film Před 3 lety +4

    Thank you so much! Im just getting started with Unity and vr-Dev and its so frustrating that the Unity-interface has changed so much in one year and its hard to set the inputs right with all the different Versions people in Tutorials explain! So thankful to find you explaining it propperly for the setup in 2021.

  • @CitizenPurpelios
    @CitizenPurpelios Před 3 lety +12

    amazing that you posted this today I JUST needed this.

  • @WilkoGRACZ
    @WilkoGRACZ Před 3 lety +9

    Andrew, thank you so much! My game has gone through 3 toolkits and this is now my final one. Professional to the point videos and nice voice! :)

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      You're very welcome, Wilko! I'm glad you enjoyed them.

  • @c0d3_m0nk3y
    @c0d3_m0nk3y Před rokem

    This is one of the most helpful Unity tutorials, I have ever seen! Thank you so much!

  • @genemedicd
    @genemedicd Před 2 lety +1

    Pure gold! I was having so much trouble and I was missing adding the Input Action Manager script. Thanks so much!

  • @CastleBomber
    @CastleBomber Před 9 měsíci +1

    dope! got through a hurdle, thanks man

  • @colincreamer
    @colincreamer Před 3 lety

    Sweet! This is supported natively now! 5 months before this video came out, i had Modified XR's Controller script to have public faceing functions so i could pass though Select and Activate actions via script. In a hakish way i could still use unitys Input system for all the controlls, and still pass them through to VR. Allowed me to simultaneously have keyboard, mouse, gamepad and oculus controller trigger things like teleportation. After seeing this video, i can now revisit this and do it properly without the need for modified library code as this type of functionality is now natively suported between the input system with the XR toolkit! Thanks!

  • @citywizardgames
    @citywizardgames Před rokem

    You're my hero, I was beating my head against the terrible default Unity instructions on this all week. Cheers man.

  • @PhillipsAlbright
    @PhillipsAlbright Před 2 lety

    great explanation of this system, even after two years.

  • @vitnovak
    @vitnovak Před 3 lety

    O M G! You actually go to the documentation and explain all the "whys"! This is so awesome!

  • @valentinsourice3780
    @valentinsourice3780 Před 3 lety +3

    This is gold, thanks for keeping us up to date

  • @Diablokiller999
    @Diablokiller999 Před 3 lety +1

    So this is how it works, didn't get my head around it for the last few days, thank you so much! :)

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      Glad it helped!

    • @VeryDavidChannel
      @VeryDavidChannel Před 3 lety +1

      By the way, the presets that you download do not have to be added to the 'Preset Manager' and labeled 'left' and 'right'. You can just create an XRRig, and then click on the individual left and right controllers, and choose the presets by clicking on the small 'preset' button in the inspector at the top right, by the help and more buttons. Thought I'd share since I ran into that!

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      @@VeryDavidChannel Yep! This can also be found in the Presets Documentation that a pinned.

  • @cedricknapp2889
    @cedricknapp2889 Před 3 lety

    Thanks Andrew! Had just read up on the new input system and I learned about it in terms of normal kB &mouse & gamepads, so it was nice to see how it applies to the XR toolkit now! :)

  • @petacrdi
    @petacrdi Před 2 lety

    Oh, man, thank you! I was missing the Input Action Manager. Great channel, very useful for beginners like me.

  • @mewing55
    @mewing55 Před 3 lety +1

    extremely helpful tutorial. combines a lot of info in a short time. great work!

  • @frozensmoketrails
    @frozensmoketrails Před 3 lety

    Thank you for this video!!
    This is stuff that should be in the official docs to begin with.

  • @IProKv
    @IProKv Před 3 lety

    THANK YOU ANDREW YOU LOOK AFTER US HOMIE, DIVINES BLESS YOU MY MAN

  • @coatube
    @coatube Před 3 lety

    best tutorial for biginner of xr toolkits . very awesome!

  • @NightSpyderTech
    @NightSpyderTech Před 3 lety

    Awesome! Can't wait for an update to the interaction system with this new method, especially the new hand interaction / posing stuff. Also really happy to finally be able to leave the legacy vr system for cross platform setup.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      Aren't we all! I'm glad we're finally getting a more straightforward solution.

  • @johnjohnhenry7645
    @johnjohnhenry7645 Před 3 lety

    GENIUS !!! I spent two days trying to understand that !

  • @davidblissett5315
    @davidblissett5315 Před 3 lety

    Thanks for showing us the way Man. Such great content. Really appreciated.

  • @pratiklohokare8591
    @pratiklohokare8591 Před 2 lety

    thank you so much bro, for this detailing

  • @dimensional7915
    @dimensional7915 Před 3 lety

    now this is what we call progress

  • @igorwidawski842
    @igorwidawski842 Před 2 lety

    Thank you Andrew! Your video has saved me a lot of time! :)

  • @hernandonj
    @hernandonj Před 2 lety

    Great video. Thanks!

  • @Xzarations
    @Xzarations Před 3 lety +4

    Does this support valve index controllers yet?

    • @DeGandalf
      @DeGandalf Před 3 lety

      I have the same question, it would be great if someone knew this.

    • @Xzarations
      @Xzarations Před 3 lety

      @@DeGandalf yeah I have been waiting for better index support for ages

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      It's limited Index Support in Unity 2019. You'll need to keep a look out for Unity's Beta OpenXR integration that'll hopefully be out by the end of the year.

    • @Xzarations
      @Xzarations Před 3 lety

      @@VRwithAndrew Thanks! I have been using steamvr sdk for over a year and I can’t wait to switch so that I can support multiple devices!

  • @josemartins-game
    @josemartins-game Před 4 měsíci

    Interesting. But how do we actually read the controller buttons ? Example A and B buttons on a meta quest controller ?

  • @dustinmilotte8852
    @dustinmilotte8852 Před 3 lety +1

    How can I read trigger value with the new input system? meaning I want to poll in update for the current amount the trigger is pressed, giving values between 0-1. The Activate action in the default set seems to only be a button.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      If you go into the action set and select the Activate action. You'll just need to change it from a Button to a Value, and set it as an Axis.

  • @KipppJ
    @KipppJ Před 3 lety

    Based.

  • @ourybah7633
    @ourybah7633 Před 3 lety

    Thank you!

  • @JamesWjRose
    @JamesWjRose Před 3 lety

    Thank you very much for this, very helpful.

  • @HRezakhani
    @HRezakhani Před 3 lety

    Thanks, it helps me a lot.

  • @adhochero6619
    @adhochero6619 Před 3 lety +1

    Thanks for the dope tut. I had a question how can you then use the inputs? when I first looked at new input system, a couple days ago, I used the Player Input component to gain access to the actions. but with the right and left controller being separate action maps you can only use one or the other for the Player Input. Im just not sure how to actually use the input to do things now.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      There may be a more permanent solution in the future, but the Input Action Manager kinda does what the Player Input component does. Only that it enables all of the Actions within each Action Set, instead of how the Player Input does it on a per Action Set basis. One way of checking for additional Input is to use the Input Action References. There should be a section on how to do this in the New Input System manual.
      docs.unity3d.com/Packages/com.unity.inputsystem@0.2/manual/Actions.html

  • @davidgarrett30
    @davidgarrett30 Před 2 lety

    Currently trying to get a button click working and it isn't. A video on that would be sweet.

    • @VRwithAndrew
      @VRwithAndrew  Před 2 lety

      I have a Custom Input Actions video that may help you.

  • @joel352
    @joel352 Před 3 lety

    This is great, thank you!
    Now I am having issues using the XR Device Simulator when trying to control the virtual HMD. I am trying to apply the same principals but I can't seem to get it.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      I tried the Device Simulator awhile back and for whatever reason, I struggled to get it to do a whole lot. It's still real early, and not well documented so I haven't done too much with it.

  • @marekrimal2371
    @marekrimal2371 Před 2 lety

    Briliant

  • @WTGDarksight
    @WTGDarksight Před 3 lety

    Thank you for the video! It helped a lot. Just wondering if there is an easy way to also add primary and secondary buttons because I noticed they were not added by default

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      Yeah! It just depends if you're just doing the basic inputs, or have it work on the currently selected object. For the basics, I'd say look into a generic New Input System video for creating actions. You can then create a new action either using the Generic XR Controller or specifically Vive and Index if you're using OpenXR.

  • @ELPIRATATUQUE
    @ELPIRATATUQUE Před 2 lety

    Awesome, Would like to use movement with Actionbased XR, any vids?

    • @VRwithAndrew
      @VRwithAndrew  Před 2 lety

      Not exactly, but I do have this video that shows how to implement XR Toolkit's built-in locomotion.
      czcams.com/video/4WiMogkep1U/video.html

  • @Grezebhr
    @Grezebhr Před 3 lety

    JEEZ! THANKS

  • @ownedge7329
    @ownedge7329 Před 3 lety

    Might be a stupid question, but when I click RMB in Hierarchy it shows only XR options without "(Action-based)", what could be wrong? Also when I click on Default Input Actions Presets - Inspector says "Unable to load this Preset, the type is not supported" =(

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      Double-check you're on a more recent version, and that there isn't a submenu for action-based components. You're only able to apply presets if you're using the correct component. Which, may explain why you can't apply the action presets.

    • @ownedge7329
      @ownedge7329 Před 3 lety

      @@VRwithAndrew Thanks! After I've updated OpenXR from 1.2.6 to 1.2.8 it finally appeared! Or editor just needed a reload for something to be applied, idk honestly, but I'm happy now, thank you!)

  • @CJRH1FILMS
    @CJRH1FILMS Před 3 lety

    Right Click > XR > "Convert Main Camera to XR Rig" ... that is my only option. What am I doing wrong?

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      Double-check that you've added XR Toolkit from the Package Manager.

  • @FPChris
    @FPChris Před 3 lety

    Do you change the Main Camera's position on it's transform or the Camera Offset's transform? Thx

  • @valentinsourice3780
    @valentinsourice3780 Před 3 lety

    Hello, I'm trying to use this action-base input system but I can not give the "XRI Default Input Actions" Asset to my script, it does not show up in the inspector ; do you have any idea ?
    I did this [SerializeField] public XRIDefaultInputActions Controls;

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      You'll want to use the type "InputActionAsset" rather than "XRIDefaultInputActions".

    • @valentinsourice3780
      @valentinsourice3780 Před 3 lety

      ​@@VRwithAndrew Thanks for your answer ! it puts me on rails.
      I used XRIDefaultInputActions because I wanted to use the Unity C# generated class from the input asset package example.
      Giving it from the inspector like I tried to do is obsolete ; now you need to do instantiate it directly from code like this :
      var test = new XRIDefaultInputActions();

  • @egrinant2
    @egrinant2 Před 3 lety

    Thanks for the info, I have been struggling for hours before watching your video. Now I could finally make the controllers work! However I have a problem with the camera, it doesnt seem to be tracking, not even the rotation. I have the project set with the new input system and followed your instructions. Headset is an Oculus Quest 2. Any suggestion? Thanks!!

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      I'm not sure about that! What version of Unity are you using? If you go to the Camera's GamObject, does it have an Action-Based poser on it?

    • @egrinant2
      @egrinant2 Před 3 lety +1

      ​@@VRwithAndrew Thanks for your help, it was in the Camera, Track Pose Driver (New Input System), I had to put Position and Rotation Action to specifically target Oculus Headset, any other preset won't work. You pointed me in the right direction!

    • @akravatorwind8976
      @akravatorwind8976 Před 3 lety

      @@egrinant2 Edgar, I encounter similar problem with you with my oculus quest.
      May i know which preset you are end up using ? I have tried Device and Center Eye Oculus. but none works.

    • @egrinant2
      @egrinant2 Před 3 lety

      @@akravatorwind8976 centerEyePosition [Oculus Headset] and centerEyeRotation [Oculus Headset]

    • @yohosuff
      @yohosuff Před 3 lety

      @@akravatorwind8976 I was able to solve this problem by following the advice here: forum.unity.com/threads/xr-interaction-toolkit-0-10-preview-is-available.1000576/#post-6497878. My problem was Active Input Handling was set to "Input Manager (old)" in Project Settings > Player.

  • @Xzarations
    @Xzarations Před 3 lety

    Awesome!

  • @flurishart612
    @flurishart612 Před 3 lety

    I have watched your videos on the action based input system multiple times but I am still confused on one thing. If you for example create an action called "test" and bind it to the primary button of the right hand controller, how can you do something when that button is pressed? I'm trying to reference a variable storing the ActionBasedController component, called controller. I can for example do bool buttonPressed = controller.selectAction.action.ReadValue(); to see if the select action is being pressed, but when I replace select with test, test beign the action I created in the action window, it wont work. Is there something else I have to do to check if an action I added is being pressed? Thx.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      That should work! Make sure you've saved the Input Asset, also assuming that all your actions are also being enabled in the Input Action Manager script.

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew Oh so I would need to write another line of code to enable the "test" action that I created in the action input window? How would u do that?

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew Yeah I'm trying this but it's not working, it's telling me "testAction" isn't valid I must be missing the step to enable it if there's something additional you have to do besides adding it in the action input window: buttonPressed = controller.testAction.action.ReadValue();

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      @@flurishart612 Depending upon how to have the action setup, you may want to try reading it as a float.

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew Yeah I'm honestly just trying to run code when the primary button on the right controller is pressed it's crazy how hard this seems to be with the new input system I've seen a lot of other comments with this same issue too I don't get what I'm missing. I double click the default Input actions asset, it pops open the action input window. On the left it has XRI HMD, XRI LeftHand, and XRI RightHand. I click XRI RightHand. Then, in the middle column, I click the + symbol. I name the new action "Test", the action type parameter is set to button. Then I click the + symbol next to that and click "add binding", and I add the primaryButton binding from generic XR controller stuff. It just doesn't let me use "Test" in my code. Here is the full code I'm using:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      using UnityEngine.InputSystem;
      using UnityEngine.XR.Interaction.Toolkit;
      public class ActionInputTest : MonoBehaviour
      {
      private bool buttonPressed; //bool that stores true or false if button is pressed
      private ActionBasedController controller;
      private void Start()
      {
      controller = GetComponent();

      }
      void Update()
      {
      //buttonPressed = controller.selectAction.action.ReadValue(); //this code works
      buttonPressed = controller.testAction.action.ReadValue(); //this code doesnt, can't find testActions
      if(buttonPressed == true)
      {
      Debug.Log("Button Pressed");
      }
      }
      }

  • @danielstrobel8369
    @danielstrobel8369 Před 3 lety

    Nice Tut.
    Is there a way to control the XR Rig via Android Smartphone?
    I tried to use:
    device rotation[HandheldARInputDevice]
    device rotation[OpenVR Headset]
    attitude[Sensor]
    But via Unity Remote 5 nothing happens.
    Do I have to set up my device differently?

    • @danielstrobel8369
      @danielstrobel8369 Před 3 lety

      Running the API also doesnt work. And anyway the workflow is too slow to test it like that.

  • @javhus
    @javhus Před 3 lety

    How do you detect button presses? Like the X and Y buttons on the oculus quest controllers for example?

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      That would be the Primary or Secondary button inputs for the Generic Controller. But, if you're using OpenXR you can access the inputs on a per controller basis if you want to be more specific.

    • @exof8824
      @exof8824 Před 3 lety

      @@VRwithAndrew Is there an easy way to change what those buttons do depending on other things? Like if you're holding something the primary button does one thing, but if you're holding something different it does something else?

  • @user-wt1oq2fx8r
    @user-wt1oq2fx8r Před 3 lety

    I updated the XR Interaction Toolkit to import the Default Input Action. However, as soon as I imported it, I saw the function [protected void OnSelectEnter (XRBaseinteractor)] part of Interactables' AxisDragInteractable.cs error occurred. I want to ask if there is a solution.

    • @user-wt1oq2fx8r
      @user-wt1oq2fx8r Před 3 lety

      It is said that no suitable method was found to override.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      @@user-wt1oq2fx8r When you're using updated version of XR Toolkit, they've updated to use EventArguments. I cover this at the beginning of my Bow and Arrow 2.0 video.

  • @flurishart612
    @flurishart612 Před 3 lety

    I was having issues making code run when the primaryButton on the right controller was pressed. After a real long time messing with this I was able to get it working, wanted to share in case someone else was having this issue. First, go double click your XRI Default Input Actions asset. Click XRI RightHand in the left column, and then click the + symbol in the middle column to create your action. I named mine Test, click it and set the Action Type in the right colum to button, then click the + symbol next to Test and click Add Binding. Click the new binding, and then in the path parameter in the right column navigate to the primaryButton for the XR controllers, check the "Generic XR Controller" checkbox. Once the Test action is created in the input action window you have to add it to the ActionBasedController script, this is what was throwing me off. Open that script and add the following, this will allow you to reference the Test action in other scripts:
    [SerializeField]
    InputActionProperty m_TestAction;

    public InputActionProperty testAction
    {
    get => m_TestAction;
    set => SetInputActionProperty(ref m_TestAction, value);
    }
    Once you have done that you can reference this action in code. The buttons are weird with this system btw too, the button press will return a float and not a bool like you would think. To make something happen when the button is pressed do if (buttonPressed > 0) instead of if(buttonPressed == true), you could also create a function and have it run when the button is triggered here is the code I used:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.InputSystem;
    using UnityEngine.XR.Interaction.Toolkit;
    public class ActionInputTest : MonoBehaviour
    {
    private float buttonPressed; //bool that stores true or false if button is pressed
    private ActionBasedController controller;
    private void Start()
    {
    controller = GetComponent();
    }
    void Update()
    {
    buttonPressed = controller.testAction.action.ReadValue();
    if (buttonPressed > 0)
    {
    Debug.Log("Button Pressed");
    }
    }
    }

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      If you're simply trying to read the value, you don't have include it in the controller. Also, the scripts that are included in Packages aren't saved between Unity re-loads. You can very well do the same thing using this script.
      github.com/C-Through/XR-OpenXR/blob/main/Assets/_OpenXR/Scripts/AssetInputExample.cs

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew Hi Andrew, sorry I'm not sure what you are explaining with this script. Are you stating that I don't need to alter the ActionBasedController using the script you provided? And yes, just simply trying to tell if the primaryButton on the right hand is pushed, and if it gets pushed run some code. I'm still not understanding how the script you provided would allow me to access an action I create called Test. I'm honestly finding all of this new system very confusing though the scripting part anyway so it's probably just not making sense to me. I get the concept, like setting up actions and then writing code to act off of the action instead of a specific controller so it can be easily reconfigured, but the coding required to do something as simple as telling if a button is pressed pretty just makes it a headache.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      @@flurishart612 If you watch the OpenXR video. I show how to use it. You may need to look into some more generic Input System videos.

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew ok thx

    • @flurishart612
      @flurishart612 Před 3 lety

      @@VRwithAndrew I think I get what you are saying now thx. Instead of adding the testAction to your controller, you could just create a script and then declare a public InputActionReference variable named test for example, and then drag the testAction from the asset window in that, and then just do buttonPressed = test.action.ReadValue(); to read the value, or do the test.action.started or performed if you just want something to happen when the button is pressed. Sounds like you could do action.ReadValue in an update function or use action.performed from a start function in your doPerformedThing example, is one method better than the other or is there a difference I'm not understanding? thx

  • @davidosorio1585
    @davidosorio1585 Před 3 lety

    How can i read the buttons values from a script?

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      If you look into more generic Input System videos, they should show you how to use the ReadValue function. I touch on it at the end of my OpenXR video.

  • @imdixon8108
    @imdixon8108 Před 3 lety

    Is there a tldr on how to setup a new action? I'm trying to subscribe to a primary button action, set it up in the action menu and mapped it to generic XR left hand. How can I access this in code to subscribe to the event, though?

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      If you look into my OpenXR video/template project there is an example there for subscribing to an input's events.

  • @Timotheeee1
    @Timotheeee1 Před 3 lety

    so there's a rotation "action" but how do you actually get the rotation out of it ? the only parameter is a callback:
    controller.rotationAction.action.performed += (UnityEngine.InputSystem.InputAction.CallbackContext obj) => { };

    • @pohyart
      @pohyart Před 3 lety

      You can actually poll actions: docs.unity.cn/Packages/com.unity.inputsystem@1.0/manual/Actions.html#polling-actions

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      @@pohyart This is correct, you can use the ReadVaue method.

  • @mireazma
    @mireazma Před 2 lety

    how to actually link the actions in XR Controller (6:30) to methods?

    • @VRwithAndrew
      @VRwithAndrew  Před 2 lety

      All of those actions are set up to select, activate, and all that. If you're trying to do additional actions for the XR Controller, it's possible but overly in-depth to do. I do cover more customization for actions in my Custom XR Actions video.

  • @mboe94
    @mboe94 Před 3 lety

    How do I use this if I want a debug.log when I press A,B X or Y on my Quest2? Do you have a script for that? Been searching for this info the past 4 days, can't move on until I know how.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      I'm putting together a simple project on this since it's a very common question. In the meantime, I would recommend looking into more generic Input System videos, and my OpenXR video. It has some info on input as well.

    • @mboe94
      @mboe94 Před 3 lety

      @@VRwithAndrew Fantastic! Looking forward to watching it ! :)

  • @ikramandaliff
    @ikramandaliff Před 3 lety

    Hey man i just wanted to know if it possible to create a spectator camera inside a vr scene with unity xr input management. I wanted to make a controlable spectator camera with mouse and keyboard but the xr input wont let me

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      In theory, I think you'd be able to do it. If you can get the camera and everything setup correctly. You may need to look into how the Input System handles multiplayer. Or, you may be able to get away with writing your own script to Activate all of the actions, and have the functionality you want hooked up to them. You can see more of that here.
      docs.unity3d.com/Packages/com.unity.inputsystem@0.2/manual/Actions.html

    • @ikramandaliff
      @ikramandaliff Před 3 lety

      @@VRwithAndrew thanks alot man! At the moment the xr input is disabling my camera control script and mouse input, need to find a way around it

  • @peterweigel2991
    @peterweigel2991 Před 3 lety

    I'm running into a problem with the action-based XR rig. I'm on an Oculus Quest 2 in Unity 2020.2. When I build and run, the scene is locked in one position. Moving my head does nothing. My controllers are also locked onto the headset's position. As a check, I ran Unity's example VR scene and had no problems on my headset. I've tried everything I can think of: building in a fresh version of Unity, building in the URP instead of 3D, and double-checking the project settings. I also deselected everything in the Unity example scene and rebuilt the room-scale action-based XR rig in there, and it worked. I must be missing a setting somewhere, but I don't know what it is. Does anyone have any idea what might be causing this, and how to fix it?

    • @peterweigel2991
      @peterweigel2991 Před 3 lety

      Update: I figured out the problem, sort of. If I run through the above tutorial in 2019.4, everything works. Then, if I reopen the project as a 2020.2 project, it works there as well. Unity does something in the background to update the project, not sure what but it works.

    • @yohosuff
      @yohosuff Před 3 lety

      @@peterweigel2991 I was able to solve this problem by following the advice here: forum.unity.com/threads/xr-interaction-toolkit-0-10-preview-is-available.1000576/#post-6497878. My problem was Active Input Handling was set to "Input Manager (old)" in Project Settings > Player.

  • @PhillipsAlbright
    @PhillipsAlbright Před 2 lety

    How do you assign new actions to controls?

    • @VRwithAndrew
      @VRwithAndrew  Před 2 lety

      Everything gets funneled into the Select, and Activate via the XRController. If you're looking at more functionality, that's a bit of a process that I don't have a video on.

  • @WesleyOverdijk
    @WesleyOverdijk Před 3 lety

    Have you figured out how to use this with XRGrabInteractables? i can't get onActivate to trigger, and the weapon I'm holding just rotates like it's inside of a microwave.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      Ahaha, what controller are you using?

    • @WesleyOverdijk
      @WesleyOverdijk Před 3 lety

      @@VRwithAndrew I have since figured it out. It was rotating because that's what the rotate anchor input does. I had to disable that. The trigger wasn't working because I'm a moron and I forgot that I had copied a scene (and didn't include it in the build).
      Thanks for the reply 😄

  • @VRwithAndrew
    @VRwithAndrew  Před 3 lety

    If you'd like to know more about saving and apply presets check out this manual from Unity.
    docs.unity3d.com/Manual/Presets.html

  • @sixsugarssixburners2318

    Thanks Andrew. I must be dumb, but wow for some reason I feel Unity is making everything somewhat more difficult. On one hand I feel getting input from controllers seems more straight forward and less (or zero) code, but on the other...there's something about how they're designing everything that makes it more annoying. Don't even get me started with ECS.

    • @KidGold17
      @KidGold17 Před 3 lety +1

      yea this is especially un-intuitive.

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety

      It's certainly not perfect. Unity is aware on how they've dropped the ball in some areas and trying to more transparent in the futre. The New Input System is very flexible and there are a lot of different ways of using it. However, the documentation is incredibly dense and it took me sometime to figure out how to do things. This is with my existing experience with Action-Based Input coming from SteamVR.

  • @markus6056
    @markus6056 Před 2 lety

    3:57
    Unity have change the name from Default Input Actions to Starter Assets

  • @tenzenin6301
    @tenzenin6301 Před 3 lety +1

    I need to have complex inputs, such as a different 'activation' of a selected or grabbed object for different button press events like trigger vs A vs B vs B + trigger vs A+ etc... Also, I need to have a teleport function that activates whenever you move the analogue stick forward, disabling the grab function, but I need to stop it from triggering when the grab is triggered.... I'm getting a headache with this stuff, you think you could make a video that goes into a little more detail, with some variation, and maybe even a little peek into how the scripts do their thing?

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      Potentially! If I have a good example/use-case off an interactable or something benefiting from additional input. Others may find that useful.

    • @tenzenin6301
      @tenzenin6301 Před 3 lety

      @@VRwithAndrew for instance, in VR chat, many of the animations require multiple buttons being pressed in combination. sometimes this loads an animation, or swaps out the model of the object that hand is holding. some objects, because of their size, like a shield in a combat game, could block fast movement such as teleport. (conditional suppression of teleport) you might also want to trigger this when in combat, or in menus, etc.

    • @tenzenin6301
      @tenzenin6301 Před 3 lety

      sorry for the late reply, I didnt see the youtube notification somehow

    • @tenzenin6301
      @tenzenin6301 Před 3 lety

      oh, maybe you could make essentially a code template that would point to several of the 'actions' and change what button each action is tied to, disable and enable it, and tie it to a set named object being 'selected' or spicifically 'grabbed' or 'raycast selected' you could also show it being called by a external script to simulate game state changes.

    • @tenzenin6301
      @tenzenin6301 Před 3 lety

      this is not to forget showing a sampling of effects these buttons could trigger, such as changing the model or triggering a particle effect, and would be good to show an example of a custom action, looks like you can just add one in the menu using the plus button at the top, but some people might not notice that. i could become a muffin supplier next month if you did this, just to get access to the template. would make a nice video though.

  • @rl1111rl
    @rl1111rl Před 3 lety

    Can you do hand-tracking with this? i.e. Quest 2

    • @VRwithAndrew
      @VRwithAndrew  Před 3 lety +1

      Not that I'm aware of, but maybe in the future. There are some pieces of documentation that additional input is possible. Right now it's exclusive to using OVR to my knowledge.

    • @rl1111rl
      @rl1111rl Před 3 lety

      @@VRwithAndrew Thanks. I'll try again with OVR. I had difficulty getting the hands to move other rigidbodies. I added a sphere collider to each hand but the sphere appeared a meter away from the hand. Not sure where I went wrong.

    • @rl1111rl
      @rl1111rl Před 3 lety

      @@VRwithAndrew Also, I think hand-tracking won't be viable for most tasks because it will never be able to handle occlusion with headset cameras alone.

  • @DominiqueLavault
    @DominiqueLavault Před rokem +1

    nice to find this info but it's already outdated... everything changed so much since the time you made that video. It's unusable now...

    • @DominiqueLavault
      @DominiqueLavault Před rokem

      ho, sorry, just jump to czcams.com/video/5ZBkEYUyBWQ/video.html

  • @Palatard
    @Palatard Před rokem

    But how do I bind a button to a custom function? I don't understand how to make the character sprint with the press of a button with this new system.

    • @VRwithAndrew
      @VRwithAndrew  Před rokem +1

      I have an additional video on this, "Custom Input Actions for Unity XR."

    • @Palatard
      @Palatard Před rokem

      @@VRwithAndrew Thank you friend. I kept finding actual button game object videos when searching for how to bind buttons.

  • @rodrigo.cs.machado
    @rodrigo.cs.machado Před 3 lety

    Thank you so much man!