Valem I love your videos! But I should say that with a little work one could use your custom hands tutorial to create hands, then hide the rigs hands and have the wrists match up haha. I'm sure your pateron is a much better solution though if anyone wants a quick solution I found that worked nicely
@valem watching you code the hell out of this, is like watching some kind of renaissance master paint the Mona Lisa. How the hell did you get to this level of confidence? Are you figuring out all those lines yourself? This is sometimes so incredibly complex, and after years of trying to learn C# I couldn't do 1% of what you're doing each episode. Just mindboggingly mindblowing. LOVE you.
@@ValemVR Yeah I get that of course. But to come up with that logic in the first place - no matter how much time you got - is still incomprehensible to me. Pure genius. And on top of that so generous. If people like you would run the world, everything would be alright.
Man, this whole series has been amazing stuff, I have been waiting for, for so long. I love this series. If you ever get time would love to see you do a series if possible on fps arms using this, I got the arms working but hand animation requires a different approach. Also, put the cherry on top in the form of Body physics for the VR body lol. Yeah, I am going to be that guy, but still gonna ask lol.
When i add the animator avatar, my mode just flys towards but past, were it should be in correlation with the head set. If i start without adding the avatar it snaps to were it should be but when i add the avatar it just stays still even if i move the camera, ik targets or controlers
Could you attach a second set of hand controllers to your feet to track foot and leg movement? Thanks! Great video. (I know I could get the Oculus pro if i could afford it for leg movement)
Can you make a tutorial on how to track full body legs in this using vive trackers? I get that we have a walking animation, but I wanna move my legs freely
Thank you very much for this great tutorial. I'm a VIVE user and use STEAM VR instead. I found out that if I follow steps in the video, at the end, my Robot would continuously fall under the ground. This got on my nerves. Could you give some solutions to this? Thanks a lot:)
This tutorial is great, as was part 1. The only real problem is that you have used a completely different structure on your rig to the first video. It does not appear to contain the constraints you made in part one, but instead, three other game objects named HEAD, LEFTHAND, RIGHTHAND. This causes a huge disruption in the consistency and flow of information when the video indicates it's a continuation. Thank you for the video though, it is very much appreciated.
I found one small problem, my hands don't align because the rig is unable to stretch, so it's assuming the player is VERY short... This makes it look super funky...
I didn't notice that the issue is actually in this video and thought it was my project that was the issue. But as can be seen here, the hands curl up, or bend inwards a bit. What's the deal with that? And how would you go around solving it? The hands are not bent similarily in the animations used from what I can tell. And this is quite breaking the whole point of only animating the lower part of the body.
This worked perfectly, thanks Valem ! But still how can we move while having a native standing height over the ground ? I mean, the body follows the vr camera, so the position of the camera define the height we should have while standing. I was thinking about coding a raycast from the vrcamera to the ground, if the size exceed a certain height value, resetting the heigt of the vrcamera to that height value. What do you think ? Is this the best way ? Thanks
Hi Valem or anyone that can help, can I use the IK hand setup while also using the animator for moving the legs? Because when I add an animator controller with an avatar my IK hand setup stops working. Not sure what to do to work pst this. Thank you , and awesome tutorials!
I am trying to create a player with SteamVR but I cannot add the walking animation to my Robot Kyle, I completed the first demo successfully...to my knowledge. I am not really certain what I am missing.
I know nothing about coding so could you please help me and my friend on how to make a model from scratch that works well in vr. (That has arms a legs.)
Same thing is happening to me. I think it is the hands interfering with the Raycast. I tried having them ignore raycast, but it didn't help. I would love a solution to this problem as well. :)
Going through this tutorial, I noticed that with a walk animations and the Robot Kyle model... EVEN with the upper body mask, the hands still curl like they are being animated somehow. If I turn off the VRFootIK script and the animator, the hands return to normal. Any idea as to why this is happening?
@Plastic Bag Just as a FPS game allows you to walk (lower body) & Aim (Upper Body) at the same time using masking, the same should work with any body part including hands. You don't simply swap an entire animation just because you don't know how to mask something.
I can't move Robot Kyle by selecting him when in game mode like you can. I can only move him if i move the OVRCamera rig. When i start game mode, he also jumps a few spaces ahead of where i spawned him. And I've done all the code, but his feet still go through the floor. And i went back over part 2 just in case i missed something, i can't find anything. Can you help me? EDIT: Nevermind, I had one line of code wrong, and i didn't delete the OVRCamra rig from when i watched part 1. Without that camera, its working just like in the video.
Hello again I just had a quick question,when I import the walking animation from mixamo to unity I dont get an animated walking preview only blue caution symbol and im not sure how to fix this as I've tried things I red online but they haven't solved my issue
When you apply the avatar, the tracking is horribly off center and the model won't match up, removing the avatar fixes the issue but we lose animations D: any fix so far? @Valem
Are you able to capture and record this kinematic data for later use? Like have a performance in VR. Record data. Have that data played on another model or animator.
Hi no worries yes you can use this and record the frame zt runtime using in an animation using this : github.com/newyellow/Unity-Runtime-Animation-Recorder Its quite simple And you will have yourself your own motion capture studio 😊
I tried to create the walking animation and it broke my character's rig, making the whole body fly off to the side, and now after stopping that it says this - UnassignedReferenceException: The variable headConstraint of vr_rig has not been assigned. You probably need to assign the headConstraint variable of the vr_rig script in the inspector. UnityEngine.Transform.get_position () in :0 vr_rig.LateUpdate () (at Assets/scripts/vr_rig.cs:45) even though the rig works regularly
Love your tutorials. I followed this one (multiple times) but once i set the avatar on the animator to be the robertkyleavatar the IK does not work anymore and the whole character freezes in its current position :( could you please help?
@@ValemVR I'm using Unity 2019.2.17f1. Also, do you know what could be the issue that my hand tracking is too low? its perfectly fine in Oculus. Thank you so much for the answer
@@ValemVR Yeah. If I put my hands in front of the VR headset for example. In Oculus I see the controller right in front of my eyes. Yet in unity the hands are at my chest :/ I can't figure out why.
I have no idea what the difference is but I setup a new scene and redid my PlayerPrefab from ground (PlayerPrefab from SteamVR + my scripts) and now it works perfectly fine. Thank you though :)
At 10:04 the code entered is related to right foot rotation (before copying to the left) - I have this copied exactly but am getting a red underscore on the last written "rightFootRotation" that reads: "Argument 2: Cannot convert from UnityEngine.Quaternion to UnityEngine.Vector3" Anyone have a fix for this? Thanks!
It used to be so hard to find good VR Unity tutorials, but this channel is like everything I've been asking for!
I feel like I've discovered the cornucopia of VR gamedev tutorials.
Valem I love your videos! But I should say that with a little work one could use your custom hands tutorial to create hands, then hide the rigs hands and have the wrists match up haha. I'm sure your pateron is a much better solution though if anyone wants a quick solution I found that worked nicely
@valem watching you code the hell out of this, is like watching some kind of renaissance master paint the Mona Lisa. How the hell did you get to this level of confidence? Are you figuring out all those lines yourself? This is sometimes so incredibly complex, and after years of trying to learn C# I couldn't do 1% of what you're doing each episode. Just mindboggingly mindblowing.
LOVE you.
Thanks man but a lot goes to the preparation when making these videos! :)
@@ValemVR Yeah I get that of course. But to come up with that logic in the first place - no matter how much time you got - is still incomprehensible to me. Pure genius. And on top of that so generous. If people like you would run the world, everything would be alright.
Would love to get finger tracking if possible, keep up the videos 👌🏻
Another IK video? Sweet!
how can we add finger tracking to it?
He has a seperate tutorial for this
@@BezbroGames patreon, unfortunately
Awesome! I was hoping for this
Man, this whole series has been amazing stuff, I have been waiting for, for so long. I love this series. If you ever get time would love to see you do a series if possible on fps arms using this, I got the arms working but hand animation requires a different approach. Also, put the cherry on top in the form of Body physics for the VR body lol. Yeah, I am going to be that guy, but still gonna ask lol.
I fixed The issue with legs going together to fix the issue im gonna paste my code so you can do it yourself
When i add the animator avatar, my mode just flys towards but past, were it should be in correlation with the head set. If i start without adding the avatar it snaps to were it should be but when i add the avatar it just stays still even if i move the camera, ik targets or controlers
can you show how to do like body calibration please.
Could you attach a second set of hand controllers to your feet to track foot and leg movement? Thanks! Great video. (I know I could get the Oculus pro if i could afford it for leg movement)
Can you make a tutorial on how to track full body legs in this using vive trackers? I get that we have a walking animation, but I wanna move my legs freely
yes i need that too
Awesome! I can be my hero in virual reality!
VERY COOL!
This is so cool! It really is. Keep up the amazing work!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VRFootIK : MonoBehaviour
{
private Animator animator;
public Vector3 footOffset;
[Range(0,1)]
public float rightFootPosWeight = 1;
[Range(0,1)]
public float rightFootRotWeight = 1;
[Range(0,1)]
public float leftFootPosWeight = 1;
[Range(0,1)]
public float leftFootRotWeight = 1;
// Start is called before the first frame update
void Start()
{
animator = GetComponent();
}
private void OnAnimatorIK(int layerIndex)
{
Vector3 rightFootPos = animator.GetIKPosition(AvatarIKGoal.RightFoot);
RaycastHit hit;
bool hasHit = Physics.Raycast(rightFootPos + Vector3.up, Vector3.down, out hit);
if(hasHit)
{
animator.SetIKPositionWeight(AvatarIKGoal.RightFoot, rightFootPosWeight);
animator.SetIKPosition(AvatarIKGoal.RightFoot, hit.point + footOffset);
Quaternion footRotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(transform.forward, hit.normal), hit.normal);
animator.SetIKRotationWeight(AvatarIKGoal.RightFoot, rightFootRotWeight);
animator.SetIKRotation(AvatarIKGoal.RightFoot, footRotation);
OnAnimate();
}
else
{
OnAnimate();
animator.SetIKPositionWeight(AvatarIKGoal.RightFoot, 0);
}
}
private void OnAnimate()
{
Vector3 leftFootPos = animator.GetIKPosition(AvatarIKGoal.LeftFoot);
RaycastHit hit;
bool hasHit = Physics.Raycast(leftFootPos + Vector3.up, Vector3.down, out hit);
if(hasHit)
{
animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, leftFootPosWeight);
animator.SetIKPosition(AvatarIKGoal.LeftFoot, hit.point + footOffset);
Quaternion footRotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(transform.forward, hit.normal), hit.normal);
animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, leftFootRotWeight);
animator.SetIKRotation(AvatarIKGoal.LeftFoot, footRotation);
}
else
{
animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, 0);
}
}
}
That should fix your guyses issue if you have one like i did
You the goat bro
Thank you very much for this great tutorial. I'm a VIVE user and use STEAM VR instead. I found out that if I follow steps in the video, at the end, my Robot would continuously fall under the ground. This got on my nerves. Could you give some solutions to this? Thanks a lot:)
I am not sure if this maybe causes another problem but in the animation you can set the root transformposition of the Y axis on bake into pose.
Thanks you so much for this
Thanks man
This tutorial is great, as was part 1. The only real problem is that you have used a completely different structure on your rig to the first video. It does not appear to contain the constraints you made in part one, but instead, three other game objects named HEAD, LEFTHAND, RIGHTHAND. This causes a huge disruption in the consistency and flow of information when the video indicates it's a continuation. Thank you for the video though, it is very much appreciated.
It's really confusing and yet I'm wondering why nobody else noticed. Looks like it's an improved version of Part 1 to me.
the legs don't bend when i lower the character into the ground, why is this happening?
I found one small problem, my hands don't align because the rig is unable to stretch, so it's assuming the player is VERY short... This makes it look super funky...
THANKS!!!
thank you so much . when will you post a tutorial in patreon for custom hands in vr body ?
my hands don't work they stay stiff pointing forward how can i fix it :(
I didn't notice that the issue is actually in this video and thought it was my project that was the issue. But as can be seen here, the hands curl up, or bend inwards a bit. What's the deal with that? And how would you go around solving it? The hands are not bent similarily in the animations used from what I can tell. And this is quite breaking the whole point of only animating the lower part of the body.
Did you ever manage to fix this? Having the same issue.
How much extra performance does this body use for a Quest game, and can i get hand tracking to work with a full body on Quest?
This worked perfectly, thanks Valem ! But still how can we move while having a native standing height over the ground ? I mean, the body follows the vr camera, so the position of the camera define the height we should have while standing. I was thinking about coding a raycast from the vrcamera to the ground, if the size exceed a certain height value, resetting the heigt of the vrcamera to that height value. What do you think ? Is this the best way ? Thanks
Thanks!!!
can we do it without animation ? bc legs are still inside the ground.
I'll make a body right now
Do you think you can make a vr game with full body tracking?
Hi Valem or anyone that can help,
can I use the IK hand setup while also using the animator for moving the legs? Because when I add an animator controller with an avatar my IK hand setup stops working. Not sure what to do to work pst this. Thank you , and awesome tutorials!
Yes
I am trying to create a player with SteamVR but I cannot add the walking animation to my Robot Kyle, I completed the first demo successfully...to my knowledge. I am not really certain what I am missing.
I know nothing about coding so could you please help me and my friend on how to make a model from scratch that works well in vr. (That has arms a legs.)
follow a blender tut on how to create full human models that has the appropriate leg, arm, torso, and head bones
Hey, can you make a video "How to make your own Room in VR"?
Use Blender... its super simple
When I move my arms down by my waist, the legs start to go all wonky like they are kicking at my waist. Anyone have any tips or have this same issue?
Same thing is happening to me. I think it is the hands interfering with the Raycast. I tried having them ignore raycast, but it didn't help. I would love a solution to this problem as well. :)
I fixed this by removing the mesh collider on the robot
in VR animator controller script, try setting Smoothing to 0.16 in inspecter, worked for me
@@Nera-whimwhams ignore raycast is work for me, becasuse the hands has a collider which will be detected by ray
Hey Valen I keep getting an error message that says 'AvatarIKGoal' does not contain a definition,can someone please tell me what I missed😅
Hey :)
Did you find a solution to the problem?
@@Nicole-Keller i did not unfortunately I chose to go with another temporary method until I knew wich version I would need to use in the end
Going through this tutorial, I noticed that with a walk animations and the Robot Kyle model... EVEN with the upper body mask, the hands still curl like they are being animated somehow. If I turn off the VRFootIK script and the animator, the hands return to normal. Any idea as to why this is happening?
@Plastic Bag Just as a FPS game allows you to walk (lower body) & Aim (Upper Body) at the same time using masking, the same should work with any body part including hands. You don't simply swap an entire animation just because you don't know how to mask something.
@@romland29 Did you manage to fix this issue? I just noticed the same thing, and it stops me from doing other things to the hands.
Did you ever manage to fix this? Having the same issue.
When I import the animation, and hit play, The play is facing the wrong way
I can't move Robot Kyle by selecting him when in game mode like you can. I can only move him if i move the OVRCamera rig. When i start game mode, he also jumps a few spaces ahead of where i spawned him. And I've done all the code, but his feet still go through the floor. And i went back over part 2 just in case i missed something, i can't find anything. Can you help me?
EDIT: Nevermind, I had one line of code wrong, and i didn't delete the OVRCamra rig from when i watched part 1. Without that camera, its working just like in the video.
What line of code was wrong the same thing is happening to me
Is this multiplayer compatible?
Can we connect XR Hands and hand tracking with this IK ?? Can anyone tell
Hello again I just had a quick question,when I import the walking animation from mixamo to unity I dont get an animated walking preview only blue caution symbol and im not sure how to fix this as I've tried things I red online but they haven't solved my issue
When you apply the avatar, the tracking is horribly off center and the model won't match up, removing the avatar fixes the issue but we lose animations D: any fix so far? @Valem
you still having the same problem?
Are you able to capture and record this kinematic data for later use? Like have a performance in VR. Record data. Have that data played on another model or animator.
Sorry if you mentioned it already in this video. Or that you plan to have it in the next video. Skimming at fast pace multiple videos right now.
Hi no worries yes you can use this and record the frame zt runtime using in an animation using this : github.com/newyellow/Unity-Runtime-Animation-Recorder
Its quite simple And you will have yourself your own motion capture studio 😊
I tried to create the walking animation and it broke my character's rig, making the whole body fly off to the side, and now after stopping that it says this - UnassignedReferenceException: The variable headConstraint of vr_rig has not been assigned.
You probably need to assign the headConstraint variable of the vr_rig script in the inspector.
UnityEngine.Transform.get_position () in :0
vr_rig.LateUpdate () (at Assets/scripts/vr_rig.cs:45)
even though the rig works regularly
Love your tutorials. I followed this one (multiple times) but once i set the avatar on the animator to be the robertkyleavatar the IK does not work anymore and the whole character freezes in its current position :( could you please help?
Which version of unity do you use? :) There was a bug with rig avatar in 2019.2.6 I believe
@@ValemVR I'm using Unity 2019.2.17f1.
Also, do you know what could be the issue that my hand tracking is too low? its perfectly fine in Oculus. Thank you so much for the answer
@@reborok what do you mean to low? Is there an offset between your real hands and the hand tracking hand?
@@ValemVR Yeah. If I put my hands in front of the VR headset for example. In Oculus I see the controller right in front of my eyes. Yet in unity the hands are at my chest :/ I can't figure out why.
I have no idea what the difference is but I setup a new scene and redid my PlayerPrefab from ground (PlayerPrefab from SteamVR + my scripts) and now it works perfectly fine. Thank you though :)
The feet never leave the ground during walking. A lot of people use animation curves for that, but it's an annoying problem to solve.
Yep you can tweak the weight of the ik depending on the distance from the ground for a better result too! :)
@@ValemVR when i rotate the head on the x axis then the y axis the body does a 180
@@pureay2700 thats because you rotate over 90 degrees so its forward is now backwards
@@pureay2700 no now its happening to me
At 10:04 the code entered is related to right foot rotation (before copying to the left) - I have this copied exactly but am getting a red underscore on the last written "rightFootRotation" that reads: "Argument 2: Cannot convert from UnityEngine.Quaternion to UnityEngine.Vector3"
Anyone have a fix for this? Thanks!
the foot rotation needs to be renamed when copy and pasting :) all good
//Foot Rotation
Quaternion LeftfootRotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(transform.forward, hit.normal), hit.normal);
animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, leftFootRotWeight);
animator.SetIKRotation(AvatarIKGoal.RightFoot, LeftfootRotation);
Quaternion RightfootRotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(transform.forward, hit.normal), hit.normal);
animator.SetIKRotationWeight(AvatarIKGoal.RightFoot, rightFootRotWeight);
animator.SetIKRotation(AvatarIKGoal.RightFoot, RightfootRotation);
I have the same issue, how did you fix it?
is anyone else getting a bunch of errors ?
@Valem My character is still passing through the floor and the knees are not bending. Any idea why I would be experiencing this?
Did you remember to attach the script to Kyle or whatever avatar you have?
i have the same issue aswell
@@reduxf4089 Is your script correct and is your avatar mask correctly defined with IK pass? These two were my reasons for similar problem.