Thanks! this holds up surprising well 3 years later, just one thing has changed at the very end with collisions that other commenters left the answer to
For my thesis I'm doing research about the use of VR as a learning environment and therefore have to build a game myself. Valem you've been so helpful, it's insane!
If people were, like me, confused that putting Player object and all children in the Player layer and disabling collision with itself didn't work, it's because in the latest versions of the SteamVR plugins, in the HandCollider prefabs, the collide spheres of the hands are on a layer called "PostProcessing". Disable collision of the "Player" layer with "PostProcessing" layer, and you should be good.
I cannot express how much I appreciate this tutorial, other people would just say "this is how to implement sliding locomotion, while you go through the simplest form of movement, pointing out the problems with it and how to attack those problems. Truly fantastic.
These tutorials have been such an incredible resource for me beginning my journey or VR development. Also I'd like to add that the way you added gravity seems like it would make the player fall at a constant rate rather than accelerate.
This video is amazing and exactly what I needed. You should seriously make a VR course that goes in to more detail with all the basics. People really need this info as it has been very hard to find until now.
I plan to make a portal esque game in vr and I haven't been able to hardly get started, but this tutorial is showing me everything I need to know! I'm so grateful and I hope the series continues to help me on my journey to release my first game B3
At 3:40 you say that OpenVR must be on top of the Oculus. In your Unity version you can change the order of them but in mine I cant. My unity version is 2021.2.14f1 and I have to use this version. Anyone knows how to change the order in this version?? Or any alternative?? Thank you very much
I downloaded unity and am working through their basic tutorials thanks to you!!! I have some ideas that I can't wait to bring to VR. Thank you for being so clear in your explanations, it's extremely motivating!
If you experience shaky hands while moving using joystick and you know your hands are not colliding with body collider and in your joystick controller you call Move function in FixedUpdate() then this is what helped me: Go to Project Settings -> Time -> Fixed Timestep (default value in my case was 0.02 which is equal to 50Hz (1/0.2) ) change it to something like 0.011 (90Hz) this makes that FixedUpdate is called 90 times a second so it matches the refresh rate of your display and update of hands is smoother/shakiness is removed.
Hey There Gamers, if you're having problems with your character collider not being where the actual player is , I made a little script y'all can use, just put it on the player object. using System.Collections; using System.Collections.Generic; using UnityEngine; public class MOVE2PLAYER : MonoBehaviour { public Transform playercent; // use the VR camera here public CharacterController charc; // Start is called before the first frame update // Update is called once per frame void Update() { charc.center = new Vector3(playercent.localPosition.x, 1.03f, playercent.localPosition.z); } } Hope this helps!
Thanks alot for this tutorial! Me and a friend want to make a VR game, but all the new Unity VR tutorials are only about the newer OpenXR integration, which I ran into some issues with. I just hope that the SteamVR plugin continues to work with newer Unity versions, since Valve has completely shifted to OpenXR, despite the OpenXR Toolkit STILL missing stuff like finger tracking (where SteamVR already gives you perfectly working hand models) and a wonky input mapping, that has the grip button incorrectly mapped (it triggers the moment you touch the controller).... If I wanted to use OpenXR I would have to manually implement some functionality via SteamVR and make a sort of hybrid system...
I imported the SteamVR Plugin version 2.5.0, but I still get the empty chrome page when I click on "Open binding UI". Do you know what I can do to fix this? Thank you in advance!
Tolstyy Okay, but how can you tell Unity to use certain actions with certain buttons/inputs like you could before the update. Or can you directly check if a button on the controller is pressed from a script in unity? Thanks for your help, I‘m really desperate.
@@liujanis636 I mean the input menu where you set all the inputs is the same before the update. Its just that they moved it to open in the steamVR app. So it needs to be open. About actually using that input in scripts Valem has covered it in this video.
TO ANYONE THAT IS STILL EXPERIENCING WEIRDNESS WITH THE HANDS: Make SURE you do the physics layer mask like in the video. If that does not work (it didn't work for me) then what you can do is make sure your game window is set to maximize on play. This fixed any jittering hands for me and I still got the hand physics I wanted.
EVERYONE WHO HAS JITTERY HANDS WHILE MOVING If moving the movement into FixedUpdate or messing with the layers didn't work like it didn't for me, find the HandColliderLeft and HandColliderRight prefabs and add interpolation to their rigidbodies, much smoother after I did that!
@@ValemVR Could you also show how we could sync the body collider and snap turn with the character controller as well? Your script for making the character controller follow the camera helped a ton with moving around but I can see in the scene view that everything else is still locked to the center of the play area and quickly desyncs after moving around. Thanks a lot for the tutorials though, they've been extremely helpful!
in case people are curious, the documentation for the SteamVR unity plugin is at the link below. this shows where you would find methods like hand.ShowController(), for instance. valvesoftware.github.io/steamvr_unity_plugin/articles/intro.html valvesoftware.github.io/steamvr_unity_plugin/api/index.html
If your still having trouble with the rotating controllers there are two prefabs named "HandColliderLeft" and Right these need to be set to the player layer as well.
ATTENTION IF YOU HAVE ANY PROBLEM READ THIS /!\ 1) If you want to have the Character Controller Capsule to follow you, I wrote a little script that should get the job down. You can find it bellow. Place it on the gameobject that has the charactercontroller and also set the CenterEye parameter of this script to be the Headset Camera in the unity editor. using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(CharacterController))] public class ColliderFollowHeadset : MonoBehaviour { private CharacterController charController; public Transform centerEye; private void Start() { charController = GetComponent(); } private void LateUpdate() { Vector3 newCenter = transform.InverseTransformVector(centerEye.position - transform.position); charController.center = new Vector3(newCenter.x, charController.center.y, newCenter.z); } } 2) IF THE HANDS ARE JITTERING its because the character movement needs to be in FixedUpdate and not Update like I did so you can do it this way instead : private Vector3 direction; void Update() { direction = Player.instance.hmdTransform.TransformDirection(new Vector3(input.axis.x, 0, input.axis.y)); } void FixedUpdate() { characterController.Move(speed * Time.deltaTime * Vector3.ProjectOnPlane(direction, Vector3.up) - new Vector3(0, 9.81f, 0) * Time.deltaTime); }
I've put your code in the Player script but I cannot find CenterEye anywhere, Im not sure what to do, as whenever I try teleport, Character controller sometimes gets in the way.
I'm having another issue though, It's impossible to lean over tables because you snap back to make the collider avoid snapping through the table. How do you fix this?
Hands stutter no matter which Update function is used. they don't stutter if you disable hands physics or rigidbody, but this also breaks other functionality (including ability to move hands). Another thing worth mentioning, with your script, character collider follows the headset, but the actual player is still in the middle of the playspace, again this causes other issues.
Hey I love your chanel! one of the best. could you please make a video on how to set up the hand controllers for vr. but please break it down for us that are new to unity
For all of those who struggle with flicking hands: For me it helped to remove line 200 „hand.mainRenderModel.transform.position = offsetPosition;“ in the HandPhysics.cs file wich handles the hands offset as I understood it.
Please take a look at Faith Barnett comment for the character collider not being where the actual player is. Also, the method shown for disabling the hand collision with the character collider does not work anymore, you need to go in the hand collider prefab and there change the layer to player.
Men I love your video in every way, It works perfectly, just one thing, when I move inside the scene the models of the hands shake a lot, is there a way to fix this ? Thanks in advance !
While I was able to "feel" my body, before disabling interaction between PlayerLayer and PostProcessing, I noticed that CharacterController moves only with joystic. If I physically walk around (room scale vr), controller does not follow. Any good tips for this? And after that (assuming that character controller would somehow follow the headset), how to tell apart room scale walking and 'head peeking' motion? So for example 'peeking' over a table with your head would not cause character controller to collide with the table?
@@arnevanraepenbusch9950 sure, this should be it, also thanks to whoever liked my reply cause that is what notified me, i guess youtube doesnt notifiy you if someone mentions you so, anyways here it is:ruclips.net/video/5NRTT8Tbmoc/видео.html
The original InteractionSystem "Player" Rig seems not to be correct since the "BodyCollider" does not follow the actual head position. On top of that... adding a "CharacterController" adds another Collision Capsule which also does not follow the heads XZ position when walking around in RealLife. This might work for seated teleportation only but not in a mix of continous standing/walking with teleport since the root does not follow and therefore the collision capsules stay where they are. Investigating further. Still a great tutorial!!
Hi, Can you please show how to do smooth rotation on the right touch pad please? Snap turning with smooth locomotion is not very desirable. Many thanks
I noticed one thing, if you put the subtraction of the gravity of the playercontroller script inside the if-statement. You will only fall when you're moving the joystick and stop in mid-air when you're not. To fix this, remove the subtraction inside the if-statement and add a separate line above the if-statement: characterController.Move(- new Vector3(0, 9.81f, 0) * Time.deltaTime);
Valem My pleasure :). I’ve had another issue also though. If I followed your comment and made the character controller always follow the player I instead had a problem that I couldn’t lean over tables becase the controller and body collider went all the way to the floor. Do you know how to fix this?
@@oliverlebert Thats again a good remark. Unfortunately thats a hard problem as we dont have any tracking on the feet. The easy way of fixing this is to actually move the center of the character controller only move if the distance with the camera exceed a certain threshold or if we are using the joystick movement . Therefore you will have some room to lean over the table with the threshold :)
@@ValemVR Wow! That sounds like a really smart fix. Didn't think of that! Thanks btw for making all these Unity SteamVR tutorials, they really are a big help and there aren't really so much alternative in that aspect. :D
Haha, I've been at work again. Just started out with Unity but it's really fun so far! This is what I've come up with to enable you to lean over tables and such by only moving the charController when the camera is a specified distance away: pastebin.com/UPVtHW2a (ColliderFollowHeadset script) The only problem with this approach is that you can go through walls etc. I am theorizing solutions atm, it's not a huge problem but it would be more streamlined if it were fixed imho. I also changed the PlayerController script a bit, I made the gravity value into a variable and I also experienced that teleportation didn't work when the line of code responsible for introducing gravity was added. So I simply put that method in an if-statement so that it would only be activated when the player was not grounded: pastebin.com/yYvceREj Edit: I now also added a Sprint function to the PlayerController script. Just make a new input action with type boolean and bind it to the variable labelled sprint. pastebin.com/T9wSci2Q
12:50 - When I change the trigger click to teleport, then save and generate the input actions, nothing's changed. If I go back into the edit window, I can see my changes are not saved Edit: Oh I have to press "replace default bindings" every time.
One of the things I am trying to figure out is how to teleport to a moving platform and make sure it works well. Also the video sets a check on the input.axis.magnitude.. if you fall off a ledge and stop moving the axis you stop falling since gravity is associated with only that line of code. If I make a 'else' and put just the gravity element and start to fall the hands start to look weird while free falling.. not sure if that can be corrected... I think it might be that the player object isn't really 'falling' but every frame getting a CharacterController.move() command.. hence why its jittery
thank you so much! I'm using VR to help kids with autism, thanks for helping. Can you do one on raycasting that can tell what object you are pointing at?
Excellente vidéo. J’ai tout aimé, même si ça va un peu vite sur les scripts. Ça utilise beaucoup de choses (préfabriquées par Steam) dont j’ignorais l’existence et l’efficacité. La question que je me pose, c’est la compatibilité avec l’oculus store. Oculus impose de retirer les library Steam des builds, c’est pourquoi j’utilise le XR rig natif de Unity (et également je n’utilise plus le rig d’Oculus pour ne pas être embêté par Steam). L’intérêt énorme que je vois au rig de Steam c’est la gestion automatique des apparences des controllers et des mains. Vidéo découverte via Reddit.🙃
Thank you so much for this awesome tutorial Valem! I added the play prefab to the player layer and disabled collision with itself but the hands still shake when I move, any ideas? Thanks again :)
@@ImLightningSam spent last 4 hours trying to figure it out, I've never touched any code in my life.. Thank you now I kind of see I was on the right path but not quite there.
Thank you for this tutorial! Very helpful and I like your way of teaching. Just one question, did anybody experience shaky hands while moving with thumbstick? (not teleporting)
@@codyswanson i dont remember the exact name but how many times it runs fixed update. Its in the physics settings. One other thing it could be is if the hands and player have colliders on them it could be collisions causing jitter so you can go to the collision layers and make a layer for your player. Put the player and hands all on that layer then set the layer to not collide with itself
@@mikesirman cool, thanks. I did the physics layer and played around with the settings I think you're talking about. Who knows heh. I'm sure I'll figure it out. Small issues for a great tutorial. :)
I know this is quite an old video, but damn this still holds up. I have one issue though in my locomotion system. It's just that when your physical headset is not in the center of the play space, the virtual body's collider tends to be at an offset and it gets super weird. Do you have any where I can go to resolve this issue? Thanks for the help man.
(this is just a copy of my comment) Hey There Gamers, if you're having problems with your character collider not being where the actual player is , I made a little script y'all can use, just put it on the player object. using System.Collections; using System.Collections.Generic; using UnityEngine; public class MOVE2PLAYER : MonoBehaviour { public Transform playercent; // use the VR camera here public CharacterController charc; // Start is called before the first frame update // Update is called once per frame void Update() { charc.center = new Vector3(playercent.localPosition.x, 1.03f, playercent.localPosition.z); } } Hope this helps!
13:35 when I save & generate, it empties my Localized String text which prevents me from the next step. EDIT: The ole restart was all it took. Thanks for the tutorial! Subscribed
When I add the TouchPad controller input at 13:16 and do what he does, I do not get any live input for the Touchpad (although I can see the controller 3D pose itself changing). Did anyone encounter this?
I am using the Index, cause that's what I have, and when I try to use the show controllers option, nothing shows up in my hands and the player hands are stiff and don't respond to finger tracking.
I'm trying to figure out how to make the player move with the headset's location as well so that I'm not forced to stay in the pre-defined position of the character controller's center, currently my actual position on my play area doesn't match the center of it so the hitbox for moving up and down slopes is next to me rather than on me. I know I could change the pre-defined position to match it but that would still limit me to stand still.
I've covered it in my video how-to (timestamp 3:22) if you want to watch it^^ The gist is to add a collider to the player prefab and update the collider's center according to the local position of the camera ;)
Have you found a good manual on Steam VR? Thanks for the excellent video! I'm trying to wean myself off of VRTK but have never been able to find good documentation on the basic Steam VR plugin. This video helps illustrate just how powerful it is, but I need to figure out some other stuff too. Like drop zones.
I'm having a recurring issue with trying to move using the touchpad, when I try to replicate the code you use (at 15:00), I get an error regarding the term "axis" - 'SteamVR_Action_Vector2' does not contain a definition for 'axis' and no accessible method 'axis' accepting a first argument of type 'SteamVR_Action_Vector2' could be found (are you missing a using directive or an assembly reference?) I tried to look it up but could find no solution to this, so if you happen to know what the problem is I would really appreciate it!
Just in case your issue is the same as mine. In my rush to type, I let the IDE autocomplete for me, and instead of using SteamVR_Action_Vector2 I was using ISteamVR_Action_Vector2 (notice the "I" for interface). This won't let you select the new input action from the drop-down like he shows in the video. Once I changed it, everything worked like in the video.
im ready to give up. no matter what i do, the colliders dont follow the actual head. Whenever i start the game, my headset is a few feet away from the actual body. Meaning if i walk into a wall, me head goes a few feet through it until the actual body collides with it. Literally no way to fix it, someone please help im getting so mad with this
I am using URP Material for that teleporting with 3D plane it's working fine. but when I try to teleport inside any gameobject(Cube..) the **Destination Reticle** and **Raycast** but is not visible. so i try with normal material which means without URP material, now in this case working fine with gameobject(Cube) but it's not visible in 3d plane.
Thanks! this holds up surprising well 3 years later, just one thing has changed at the very end with collisions that other commenters left the answer to
Thank you so much you're the first one to have donated through super thanks on this channel
You are literally the king of Unity VR tutorials, and I’m very grateful.
We spent $10,000 on VR. Vive Headset, Valve Controllers. IT DOES NOT WORK!! IT IS A SCAM!!!!
@@vrforseniors9830 cuz vive has it s own integration in unity, dumbasses.
@@vrforseniors9830 Lol, you have no clue what you're talking about, I even doubt that you have the amount of money mentioned above...
For my thesis I'm doing research about the use of VR as a learning environment and therefore have to build a game myself. Valem you've been so helpful, it's insane!
BULSHIT!! THE CHEAP PLATIC CRAP FROM VALVE SUCKS! AND VALVE HATES CUSTOMERS!!!!!
If people were, like me, confused that putting Player object and all children in the Player layer and disabling collision with itself didn't work, it's because in the latest versions of the SteamVR plugins, in the HandCollider prefabs, the collide spheres of the hands are on a layer called "PostProcessing".
Disable collision of the "Player" layer with "PostProcessing" layer, and you should be good.
Thank you so much! Was wracking my brain about what was the cause, thanks for saving me a lot of time!!!!
i dont understand can you help please
@@mikeelina1733 In the newer version you need to make the player layer and post processing layer not interact in project settings.
Zaney thank you
@@mikeelina1733 No problem ;D
I cannot express how much I appreciate this tutorial, other people would just say "this is how to implement sliding locomotion, while you go through the simplest form of movement, pointing out the problems with it and how to attack those problems. Truly fantastic.
Engineer Gaming
These tutorials have been such an incredible resource for me beginning my journey or VR development. Also I'd like to add that the way you added gravity seems like it would make the player fall at a constant rate rather than accelerate.
I just started trying to develop a VR game, so this is really helpful! Thanks man!
how much did you learn in 4 months?
He quit and went back to playing video games
Hm.... is it done yet? Or is it in steam I might try the game out!
This video is amazing and exactly what I needed. You should seriously make a VR course that goes in to more detail with all the basics. People really need this info as it has been very hard to find until now.
BULSHIT!! THE CHEAP PLATIC CRAP FROM VALVE SUCKS! AND VALVE HATES CUSTOMERS!!!!!
This is so cool! I'm super hyped to see what everyone else is making in 2020 :D
I plan to make a portal esque game in vr and I haven't been able to hardly get started, but this tutorial is showing me everything I need to know! I'm so grateful and I hope the series continues to help me on my journey to release my first game B3
You're so helpful ! Thanks so much for your time and energy. It's always a pleasure to learn from you. Keep going on dude, you're the best.
This video is the best video i found on teleportation using STEAM VR -- Great Job!
At 3:40 you say that OpenVR must be on top of the Oculus. In your Unity version you can change the order of them but in mine I cant. My unity version is 2021.2.14f1 and I have to use this version. Anyone knows how to change the order in this version?? Or any alternative??
Thank you very much
These tutorials are exactly what I was looking for. Thank you so much!
I have been waiting for this kind of content for so long. Your contribution of knowledge is very profound. I am grateful. Thank you.
You make some of the best Unity VR tutorials I've seen on RUclips. Keep up the good work!
I downloaded unity and am working through their basic tutorials thanks to you!!! I have some ideas that I can't wait to bring to VR. Thank you for being so clear in your explanations, it's extremely motivating!
Très bonne vidéo et très bon anglais! Je viens juste de commencer le développement VR et je regarde seulement t'es tuto depuis. Génial!
better than the two courses i bought on udemy ,really appreciate it!
Je suis un développeur sur unity et je sais parler Français comme vous Valem, continuez les vidéos, elles sont intéressantes. :)
Amazing tutorial! Thank you so much!
If you experience shaky hands while moving using joystick and you know your hands are not colliding with body collider and in your joystick controller you call Move function in FixedUpdate() then this is what helped me:
Go to Project Settings -> Time -> Fixed Timestep (default value in my case was 0.02 which is equal to 50Hz (1/0.2) ) change it to something like 0.011 (90Hz) this makes that FixedUpdate is called 90 times a second so it matches the refresh rate of your display and update of hands is smoother/shakiness is removed.
Hey There Gamers, if you're having problems with your character collider not being where the actual player is , I made a little script y'all can use, just put it on the player object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MOVE2PLAYER : MonoBehaviour
{
public Transform playercent; // use the VR camera here
public CharacterController charc;
// Start is called before the first frame update
// Update is called once per frame
void Update()
{
charc.center = new Vector3(playercent.localPosition.x, 1.03f, playercent.localPosition.z);
}
}
Hope this helps!
Thank you :)
How to use vr camera in the script?
BULSHIT!! THE CHEAP PLATIC CRAP FROM VALVE SUCKS! AND VALVE HATES CUSTOMERSE EVEN MORE THAN STEAM HATES CUSTOMERS!!!!
God I love this channel, one of the few comprehensive VR tut providers on YT. thank you valem!!!!
Thank you Ethan this goes directly to my heart 😊
Thanks alot for this tutorial! Me and a friend want to make a VR game, but all the new Unity VR tutorials are only about the newer OpenXR integration, which I ran into some issues with.
I just hope that the SteamVR plugin continues to work with newer Unity versions, since Valve has completely shifted to OpenXR, despite the OpenXR Toolkit STILL missing stuff like finger tracking (where SteamVR already gives you perfectly working hand models) and a wonky input mapping, that has the grip button incorrectly mapped (it triggers the moment you touch the controller)....
If I wanted to use OpenXR I would have to manually implement some functionality via SteamVR and make a sort of hybrid system...
Thank you for sharing this tutorial video, I am studying how to use StreamVR with HTC VIVE.
So many Ants :D Hard to understand sometimes, but glad your videos exist ^^ Thank you so much
For anyone having problems with opening the UI binding menu you need to update STEAMVR in unity
I imported the SteamVR Plugin version 2.5.0, but I still get the empty chrome page when I click on "Open binding UI". Do you know what I can do to fix this? Thank you in advance!
@@liujanis636 The binding UI should open in the steamVR app. Do you have it installed? Otherwise update it maybe.
Tolstyy Okay, but how can you tell Unity to use certain actions with certain buttons/inputs like you could before the update. Or can you directly check if a button on the controller is pressed from a script in unity? Thanks for your help, I‘m really desperate.
@@liujanis636 I mean the input menu where you set all the inputs is the same before the update. Its just that they moved it to open in the steamVR app. So it needs to be open. About actually using that input in scripts Valem has covered it in this video.
Tolstyy Thank you for your help. I figured it out. The problem was that they changed the port of the localhost URL. It now is 27062
Awesome! Would love more of this!
Please, more STEAM VR tutorials))
Great as always!!!!!
Thank you--amazing video! Very thankful for your super current information and excellent teaching.
Really good thanks for making these videos very helpful.
Great vid! Keep up the good work!
Excellent tutorial! Very good and many thanks!
the switch so scene Teleport Point needs some script to really change the scene, will you make tutorial on this too? :)
Great like always!
Great video!
Thank you! this is what i needed. ^.^/ Hope to see your next video soon...:D
Amazing tutorial! Thanks.
TO ANYONE THAT IS STILL EXPERIENCING WEIRDNESS WITH THE HANDS:
Make SURE you do the physics layer mask like in the video. If that does not work (it didn't work for me) then what you can do is make sure your game window is set to maximize on play. This fixed any jittering hands for me and I still got the hand physics I wanted.
Thank you!!! I do not have the slightest clue why this fixes the issue but you saved me a headache. Thank you thank you!!
amazing tutorial, you rock
Super helpful!! Thx buddy 😃👍
thank you so much dude! you are the best
Can't thank you enough Valem
EVERYONE WHO HAS JITTERY HANDS WHILE MOVING
If moving the movement into FixedUpdate or messing with the layers didn't work like it didn't for me, find the HandColliderLeft and HandColliderRight prefabs and add interpolation to their rigidbodies, much smoother after I did that!
Thanks for the update I will add it to the pinned comment! :)
@@ValemVR Could you also show how we could sync the body collider and snap turn with the character controller as well? Your script for making the character controller follow the camera helped a ton with moving around but I can see in the scene view that everything else is still locked to the center of the play area and quickly desyncs after moving around. Thanks a lot for the tutorials though, they've been extremely helpful!
Hey, thanks for this! That improved it, but some jittering still happens when free-falling, but on a much smaller scale.
YES, thank you so much, works like a charm!
If you dont find the HandCollider prefabs, they are in SteamVR / InteractionSystem / Core / Prefabs
Very cool video. Thank you very much =)
These are great tutororials +1 sub
in case people are curious, the documentation for the SteamVR unity plugin is at the link below. this shows where you would find methods like hand.ShowController(), for instance.
valvesoftware.github.io/steamvr_unity_plugin/articles/intro.html
valvesoftware.github.io/steamvr_unity_plugin/api/index.html
Easily the best Steam VR tutorial. All others are ranging from dysfunctional, to obsolete.
BULSHIT!! THE CHEAP PLATIC CRAP FROM VALVE SUCKS! AND VALVE HATES CUSTOMERSE VEN MORE THAN STEAM HATES CUSTOMERS!!!!
Hey merci sérieux tes tutos sont malades je t'aime
Moi aussi je t'aime 💜
Thank you !
Ролики по виару не делал?
@@eloreneloreneloreneloreneloren Только по выбору шлема и фиксации на голове. Уроки ещё не пилил. Пока не до виара, куча других дел.
If your still having trouble with the rotating controllers there are two prefabs named "HandColliderLeft" and Right these need to be set to the player layer as well.
ATTENTION IF YOU HAVE ANY PROBLEM READ THIS /!\
1) If you want to have the Character Controller Capsule to follow you, I wrote a little script that should get the job down. You can find it bellow. Place it on the gameobject that has the charactercontroller and also set the CenterEye parameter of this script to be the Headset Camera in the unity editor.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class ColliderFollowHeadset : MonoBehaviour {
private CharacterController charController;
public Transform centerEye;
private void Start()
{
charController = GetComponent();
}
private void LateUpdate()
{
Vector3 newCenter = transform.InverseTransformVector(centerEye.position - transform.position);
charController.center = new Vector3(newCenter.x, charController.center.y, newCenter.z);
}
}
2) IF THE HANDS ARE JITTERING its because the character movement needs to be in FixedUpdate and not Update like I did so you can do it this way instead :
private Vector3 direction;
void Update()
{
direction = Player.instance.hmdTransform.TransformDirection(new Vector3(input.axis.x, 0, input.axis.y));
}
void FixedUpdate()
{
characterController.Move(speed * Time.deltaTime * Vector3.ProjectOnPlane(direction, Vector3.up) - new Vector3(0, 9.81f, 0) * Time.deltaTime);
}
I've put your code in the Player script but I cannot find CenterEye anywhere, Im not sure what to do, as whenever I try teleport, Character controller sometimes gets in the way.
@@rzzz6184 centerEye should refer to your VR Camera.
I'm having another issue though, It's impossible to lean over tables because you snap back to make the collider avoid snapping through the table. How do you fix this?
Valem , the jitter still exists even with the code you provided, but it only jitters in game view, on scene view it does not jitter.
Hands stutter no matter which Update function is used. they don't stutter if you disable hands physics or rigidbody, but this also breaks other functionality (including ability to move hands). Another thing worth mentioning, with your script, character collider follows the headset, but the actual player is still in the middle of the playspace, again this causes other issues.
Hey I love your chanel! one of the best. could you please make a video on how to set up the hand controllers for vr. but please break it down for us that are new to unity
For all of those who struggle with flicking hands: For me it helped to remove line 200 „hand.mainRenderModel.transform.position = offsetPosition;“ in the HandPhysics.cs file wich handles the hands offset as I understood it.
That solved my jittering controllers issue too. Thanks a lot!
hell yeah! Thanks!!
You. Are. A. God.
Please take a look at Faith Barnett comment for the character collider not being where the actual player is. Also, the method shown for disabling the hand collision with the character collider does not work anymore, you need to go in the hand collider prefab and there change the layer to player.
Men I love your video in every way, It works perfectly, just one thing, when I move inside the scene the models of the hands shake a lot, is there a way to fix this ? Thanks in advance !
Thanks!!!
While I was able to "feel" my body, before disabling interaction between PlayerLayer and PostProcessing, I noticed that CharacterController moves only with joystic.
If I physically walk around (room scale vr), controller does not follow. Any good tips for this?
And after that (assuming that character controller would somehow follow the headset), how to tell apart room scale walking and 'head peeking' motion?
So for example 'peeking' over a table with your head would not cause character controller to collide with the table?
I would also like to know how to do this
i can't figure out how either
Watch his other tutorials not for steam vr about the movement and you will have to change some things but it will work worked for me
@@orcinus6792 Can you link the exact video?
@@arnevanraepenbusch9950 sure, this should be it, also thanks to whoever liked my reply cause that is what notified me, i guess youtube doesnt notifiy you if someone mentions you so, anyways here it is:ruclips.net/video/5NRTT8Tbmoc/видео.html
hey can you show us how to teleport to a teleportpoint and be facing a different direction upon landing
we love you
The original InteractionSystem "Player" Rig seems not to be correct since the "BodyCollider" does not follow the actual head position. On top of that... adding a "CharacterController" adds another Collision Capsule which also does not follow the heads XZ position when walking around in RealLife. This might work for seated teleportation only but not in a mix of continous standing/walking with teleport since the root does not follow and therefore the collision capsules stay where they are. Investigating further. Still a great tutorial!!
Hi, Can you please show how to do smooth rotation on the right touch pad please? Snap turning with smooth locomotion is not very desirable. Many thanks
Thanks bro
I noticed one thing, if you put the subtraction of the gravity of the playercontroller script inside the if-statement. You will only fall when you're moving the joystick and stop in mid-air when you're not. To fix this, remove the subtraction inside the if-statement and add a separate line above the if-statement: characterController.Move(- new Vector3(0, 9.81f, 0) * Time.deltaTime);
You are right. Thank you for pointing that out! :)
Valem My pleasure :). I’ve had another issue also though. If I followed your comment and made the character controller always follow the player I instead had a problem that I couldn’t lean over tables becase the controller and body collider went all the way to the floor. Do you know how to fix this?
@@oliverlebert Thats again a good remark. Unfortunately thats a hard problem as we dont have any tracking on the feet. The easy way of fixing this is to actually move the center of the character controller only move if the distance with the camera exceed a certain threshold or if we are using the joystick movement . Therefore you will have some room to lean over the table with the threshold :)
@@ValemVR Wow! That sounds like a really smart fix. Didn't think of that! Thanks btw for making all these Unity SteamVR tutorials, they really are a big help and there aren't really so much alternative in that aspect. :D
Haha, I've been at work again. Just started out with Unity but it's really fun so far! This is what I've come up with to enable you to lean over tables and such by only moving the charController when the camera is a specified distance away: pastebin.com/UPVtHW2a (ColliderFollowHeadset script) The only problem with this approach is that you can go through walls etc. I am theorizing solutions atm, it's not a huge problem but it would be more streamlined if it were fixed imho.
I also changed the PlayerController script a bit, I made the gravity value into a variable and I also experienced that teleportation didn't work when the line of code responsible for introducing gravity was added. So I simply put that method in an if-statement so that it would only be activated when the player was not grounded: pastebin.com/yYvceREj
Edit: I now also added a Sprint function to the PlayerController script. Just make a new input action with type boolean and bind it to the variable labelled sprint. pastebin.com/T9wSci2Q
12:50 - When I change the trigger click to teleport, then save and generate the input actions, nothing's changed. If I go back into the edit window, I can see my changes are not saved
Edit: Oh I have to press "replace default bindings" every time.
This is much more efficient then using the oculus integration
One of the things I am trying to figure out is how to teleport to a moving platform and make sure it works well. Also the video sets a check on the input.axis.magnitude.. if you fall off a ledge and stop moving the axis you stop falling since gravity is associated with only that line of code. If I make a 'else' and put just the gravity element and start to fall the hands start to look weird while free falling.. not sure if that can be corrected... I think it might be that the player object isn't really 'falling' but every frame getting a CharacterController.move() command.. hence why its jittery
ceci est incroyable. mbc!
thank you so much! I'm using VR to help kids with autism, thanks for helping. Can you do one on raycasting that can tell what object you are pointing at?
thank you.
Excellente vidéo. J’ai tout aimé, même si ça va un peu vite sur les scripts. Ça utilise beaucoup de choses (préfabriquées par Steam) dont j’ignorais l’existence et l’efficacité. La question que je me pose, c’est la compatibilité avec l’oculus store. Oculus impose de retirer les library Steam des builds, c’est pourquoi j’utilise le XR rig natif de Unity (et également je n’utilise plus le rig d’Oculus pour ne pas être embêté par Steam). L’intérêt énorme que je vois au rig de Steam c’est la gestion automatique des apparences des controllers et des mains. Vidéo découverte via Reddit.🙃
Cest exactement ca! J'espère que bientôt Oculus et Steam VR vont se diriger vers un sdk commun mais pour l instant, VRTK est une solution. :)
18:40 nah, you're wrong. When we fall, we will be able to lift our finger up so the input will be zero, and then we won't fall...
Thank you so much for this awesome tutorial Valem! I added the play prefab to the player layer and disabled collision with itself but the hands still shake when I move, any ideas? Thanks again :)
BULSHIT!! THE CHEAP PLATIC CRAP FROM VALVE SUCKS! AND VALVE HATES CUSTOMERSE VEN MORE THAN STEAM HATES CUSTOMERS!!!!
Merci ! 🐻
Very nice video, any tips on "Crouch" so i can pick stuff up from the floor?
or even better, remote/distance grab..
I'd rather have the movement be relative to the direction of the left controller. How do I do that?
Player.instance.leftHand.transform.TransformDirection(new Vector3(input.axis.x, 0, input.axis.y));
@@ImLightningSam Thanks! Much appreciated!
@@ImLightningSam spent last 4 hours trying to figure it out, I've never touched any code in my life.. Thank you now I kind of see I was on the right path but not quite there.
You're god mann
if hands are pink you need to right click on it and reimport all assets
Youll need to convert the assets to URP compatible in Edit > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials
I followed your tutorial
But my hands are not importing the textures they are pink
Why?
Thank you for this tutorial! Very helpful and I like your way of teaching. Just one question, did anybody experience shaky hands while moving with thumbstick? (not teleporting)
I had that. Go to project settings and Time and then set the physics check to a higher number. I set mine to 90 and it fixed it.
@@mikesirman what's physics check? I don't see that option. Thanks
@@codyswanson i dont remember the exact name but how many times it runs fixed update. Its in the physics settings. One other thing it could be is if the hands and player have colliders on them it could be collisions causing jitter so you can go to the collision layers and make a layer for your player. Put the player and hands all on that layer then set the layer to not collide with itself
@@mikesirman cool, thanks. I did the physics layer and played around with the settings I think you're talking about. Who knows heh. I'm sure I'll figure it out. Small issues for a great tutorial. :)
I found this article that explains why. Very informative!
www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8
I know this is quite an old video, but damn this still holds up. I have one issue though in my locomotion system. It's just that when your physical headset is not in the center of the play space, the virtual body's collider tends to be at an offset and it gets super weird. Do you have any where I can go to resolve this issue? Thanks for the help man.
(this is just a copy of my comment)
Hey There Gamers, if you're having problems with your character collider not being where the actual player is , I made a little script y'all can use, just put it on the player object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MOVE2PLAYER : MonoBehaviour
{
public Transform playercent; // use the VR camera here
public CharacterController charc;
// Start is called before the first frame update
// Update is called once per frame
void Update()
{
charc.center = new Vector3(playercent.localPosition.x, 1.03f, playercent.localPosition.z);
}
}
Hope this helps!
@@leaves_reality Thank you so much for this!
U ve a french accent ! R u ? ^^ thx a lot, all ur videos are so usefull, u rock ;)
13:35 when I save & generate, it empties my Localized String text which prevents me from the next step.
EDIT: The ole restart was all it took. Thanks for the tutorial! Subscribed
Sir, what can I do to make a game for my homemade DIY headset and its controllers?
When I add the TouchPad controller input at 13:16 and do what he does, I do not get any live input for the Touchpad (although I can see the controller 3D pose itself changing). Did anyone encounter this?
I dont see my XR settings only my other settings.
I am using the Index, cause that's what I have, and when I try to use the show controllers option, nothing shows up in my hands and the player hands are stiff and don't respond to finger tracking.
Get rid of the CameraRig and add the Player asset.
@@gooe9561 thank you so much, I've been holding off on this tutorial until I fixed this
i have problem how to teleport with vive controler
GREAT JOB!!!
How can i make teleportation area invisible?
I'm trying to figure out how to make the player move with the headset's location as well so that I'm not forced to stay in the pre-defined position of the character controller's center, currently my actual position on my play area doesn't match the center of it so the hitbox for moving up and down slopes is next to me rather than on me. I know I could change the pre-defined position to match it but that would still limit me to stand still.
I'm trying to figure this out too. let me know if you find a solution
I've covered it in my video how-to (timestamp 3:22) if you want to watch it^^ The gist is to add a collider to the player prefab and update the collider's center according to the local position of the camera ;)
@@einthomas614 Yeah I figured it out as well, also made it follow only when using the joystick so it won't prevent me from leaning over objects
Have you found a good manual on Steam VR? Thanks for the excellent video! I'm trying to wean myself off of VRTK but have never been able to find good documentation on the basic Steam VR plugin. This video helps illustrate just how powerful it is, but I need to figure out some other stuff too. Like drop zones.
I'm having a recurring issue with trying to move using the touchpad, when I try to replicate the code you use (at 15:00), I get an error regarding the term "axis" - 'SteamVR_Action_Vector2' does not contain a definition for 'axis' and no accessible method 'axis' accepting a first argument of type 'SteamVR_Action_Vector2' could be found (are you missing a using directive or an assembly reference?)
I tried to look it up but could find no solution to this, so if you happen to know what the problem is I would really appreciate it!
did you add the "using Valve.VR;
" and "using Valve.VR.InteractionSystem;" at the top?
Just in case your issue is the same as mine. In my rush to type, I let the IDE autocomplete for me, and instead of using SteamVR_Action_Vector2 I was using ISteamVR_Action_Vector2 (notice the "I" for interface). This won't let you select the new input action from the drop-down like he shows in the video. Once I changed it, everything worked like in the video.
im ready to give up. no matter what i do, the colliders dont follow the actual head. Whenever i start the game, my headset is a few feet away from the actual body. Meaning if i walk into a wall, me head goes a few feet through it until the actual body collides with it. Literally no way to fix it, someone please help im getting so mad with this
turn on the body collider included in the player prefab
@@-nickdev Didn't work for me :(
geat, great.
what do you recomend for a UI for VR, for change scenes and activate tutorials for the players?
Merci !
Is there a XR Device simulator, similar to the one in Unity's XR Interaction Toolkit ?
I am using URP Material for that teleporting with 3D plane it's working fine. but when I try to teleport inside any gameobject(Cube..) the **Destination Reticle** and **Raycast** but is not visible. so i try with normal material which means without URP material, now in this case working fine with gameobject(Cube) but it's not visible in 3d plane.