- Home /
Steam Vr Hands lagg behind when i move
so I am using the player prefab. and I have a script so that when I touch the touchpad it moves the player. the moving works fine except my hands lag behind when i move
private void Start()
{
Char = transform.GetComponent<CharacterController>();
}
public void Update()
{
if (IsGrounded())
{
Vel = (Physics.gravity.normalized * .1f);
}
Vector3 MoveDirection = Cam.TransformDirection(new Vector3(TouchPadInput.axis.x, 0, TouchPadInput.axis.y));
Char.center = new Vector3(Cam.localPosition.x, Char.center.y, Cam.localPosition.z);
Char.Move(Speed * Time.deltaTime * Vector3.ProjectOnPlane(MoveDirection,Vector3.up));
Vel += Physics.gravity * (Time.deltaTime * Time.deltaTime);
Char.Move(Vel);
}
}
Comment
Answer by renren30 · Apr 21, 2020 at 04:58 AM
Try to remove the .normalized in your "Vel" variable. I never made a game for vr but everything else looks right for me.
"If the vector is too small to be normalized a zero vector will be returned." I think this can be your problem. (From the documentation)
Answer by TheMaster_123 · Apr 21, 2020 at 06:35 AM
no, I don't think that's the case because the vel is for gravity and I had the hand jitter problem before I added the vel variable.