I'm delighted with the fact that this video is helping me solve problems that I couldn't solve elsewhere. A massive thanks to you for explaining the steps so well.
One more thing, the above comment was off the back of having just completed part one. In part 2 I've made it to 06:50 having typed the script for ThumbValue. A bit of a head-scratcher, the thumb doesn't animate in Play when buttons are pressed. Script and compiler show no errors, animation preview pane does have a working animation. Any suggestions ? Thanks
At first i thought it will be so much tideous work to animate the hands by myself but i ended up really enjoying it to make my own delicate hand gesture and animation :) Thank you for the good explanation and inspiration ! I couldn't follow the blend tree part unfortunately, but since i only have a grab state and an idle state, i think i just use the state mashine and a bool :) Using the float value for trigger and grip button looks really cool tho! Definitley gonna come back for this!
For anyone struggling with the Inputdevices list index out of bounds error I fixed it by putting GetInputDevice() in the update method instead. Then when the list contains something stop checking with a boolean.
Hey I am unable to add the XR Hand Controller (script) to the hands to make the right hand a right hand ( not a left hand on my right hand) It doesent show a spot i can add it and it tells me to do it threw the asset post processor.
Yes, I just got these this morning when opening the project to resume the tutorial. 'Else' being the problem. Did you find a solution? PS, I'm guessing your thumb didn't work either?
I get this error in the console: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index can you tell me how to solve it? thank you!
Nice tutorial. Very informational and educational...Worked great up until I tried to clone the left hand to the right. I put the cloned prefab into the model prefab for the right hand controller, rotated it to the proper orientation but it does not animate the right hand. I'm curious if the fact that I'm using the newer XR Origin (as XR Rig has been deprecated) has any bearing. I'm obviously missing something.
Ok. I got it. When I created the animation object for the left hand, I named it LeftHand. When I duplicated the prefab of the left hand and renamed it RightHand, I also changed the name of the animation object to RightHand. Unity was not very happy about that. With a few minor tweaks, everything is working perfeclty.
Everytime I try to build, it says “error building player because scripts have compile errors in the editor” I’ve tried everything people have suggested on google nothings worked :(
thanks for your tutorials! I am having an issue though after adding the new script and pressing play I am met with a "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the collection"
thanks for such valuable tutorial, I want to ask if this is applicable for Quest 2 as well because it gives an error saying: Index was out of range. Must be non-Negative and less than the size of the collection. it gives this with this line of code: return inputDevices[0]; Please I need to fix this
Hello, first time doing any of this and working with the Quest 1. I got everything coded right I think, but i am unable to get the grip button to operate the 3 fingers. I am on Version 20203.3 and have the XR controller "action Based", so not sure if that is the problem, or something weird between quest 2 and quest 1. Any advice would be appreciated.
Hi thanks for the amazing tutorial. I have two problems: 1. when I press the gripbutton my thumb moves instead of the three fingers. 2. The three fingers won't move at all. Could this have something to do with my bindings? Hope you respond Edit: apparently the three fingers move when I press the primary and secondary buttons
Instead of flexing my fingers using the buttons on the vive controller, I want to flex my fingers with some keycode (ex:a,w,s,d) on the keyboard. I want to know how.
Hey I need some help... I got the hands working and stuff but when I use the hands to grab an object, the animation gets stuck and won’t reset. tbh I can’t figure out how to fix it
Hi! I'm stuck on the XRHandController script. I copied and pasted the same exact script you used but Unity is telling me all sorts of errors like: The namespace already contains a definition for 'XRHandController' The namespace already contains a definition for 'HandType' Type 'XRHandController' already defines a member called 'Start' with the same parameter types Type 'XR HandController already defines a member called 'Update' with the same parameter types Type 'XR HandController already defines a member called 'GetInputDevice' with the same parameter types Type 'XR HandController already defines a member called 'AnimateHand' with the same parameter types I'm using version Unity 2020.2. Please help! Thanks
This sounds like you have two files named XRHandController? or maybe you copied the same thing twice in one class? The error you posted about means there is a duplicate definition got XRHandController. So check that out. Something you can do to find it if you use visual studio is highlight XRHandController and use ctrl+shift+f to search for all text like XRHandController. VS should now show you where all your XRHandControllers are.
@@Novaborn Hi I checked but I only have one file named XR HandController. I've also went over my code again and it is exactly the same as the one described in your video but I'm not sure why all these errors are popping up.
im stuck on the XRHandController script, visual studio is not reading Animator or InputDevice as actual variables, the color is staying white instead of turning green to signify its a type of variable. i have all the required using libraries but it doesn't recognize those two as variables
I had this problem before in an older version of Unity. I think what I did was go to Preferences -> External Tools. Then I made some changes there. Currently when I go to my settings in Unity, I have Visual Studio Community 2019 as my External Script Editor. Next I have Embedded packages and Local packages checked. If that doesn't work for you, you need to Google something like "using UnityEngine not defined in Visual Studio." Sorry if I wasn't more helpful. I do remember this being a pain to resolve for me.
I know that it has been a year, but I'm posting this solution for other people who might read it: Run the Visual Studio installer and click modify. This will open a menu. Add the Unity 3D module by checking the little box. Relaunch Visual Studio and everything should work
I have a problem: (oculus rift S: my code never enter in the IF condition so Thumb can't change value): it's like "if (primaryTouched || secondaryTouched)" is not the right one inputDevice.TryGetFeatureValue(CommonUsages.primaryTouch, out bool primaryTouched); inputDevice.TryGetFeatureValue(CommonUsages.secondaryTouch, out bool secondaryTouched); it's like it can't recognize primaryTouch or secondaryTouch (no input revealed). What could I do?
it keeps saying MissingComponentException: There is no 'Animator' attached to the "LeftHand Controller" game object, but a script is trying to access it. You probably need to add a Animator to the game object "LeftHand Controller". Or your script needs to check if the component is attached before using it. UnityEngine.Animator.SetFloat (System.String name, System.Single value) (at :0) XRHandController.AnimateHand () (at Assets/XRHandController.cs:75) XRHandController.Update () (at Assets/XRHandController.cs:34)