It works, but if you lift the object right underneath you, you will get an error. So, after messing around, I found that it was related to controller angle relative to surface. If it was bigger than set jump angle, diffXZLength * Mathf.Tan(angleInRadian) would be less than diff.y and you will get negative square root in jumpSpeed, which results to NaN. Here is the fix. Just replace angleInRadian with this. float angleInRadian = Mathf.Clamp(diff.normalized.y * 90, jumpAngleInDegree, 90) * Mathf.Deg2Rad;
Very nice tutorial, though I have a problem. When I try to implement ComputeVelocity(), my object suddenly won't budge when flicking my hand. Vector3.Up still works. Does anyone know how to fix this?
Valem, your tutorial are awesome. Since you have a lot of knowledge I was wondering if you could advice me on how to make a functioning glovebox in VR. So a box with gloves models attached, where you can put hands, and than those gloves should fit to your hands and move around with your hands. Obviously I would also use the hand tracking system from Unity, so no controllers. This sounds really difficult but surely there's a way on how to do this.Maybe with some sort of animations?..Any advice would be very appreciated.
We'll get a bug if the object is roughly below us. When calculating the jump speed under the root, there will be a negative value, which will accordingly lead to a crash. it is related to the variable diffXZLength
Same here. I was scrolling the comments for that reason. I made workaround but now it simply just don't move the object when in this position: float angleInRadian = jumpAngleInDegrees * Mathf.Deg2Rad; float denominator = 2 * Mathf.Cos(angleInRadian) * Mathf.Cos(angleInRadian) * (diffXZ.magnitude * Mathf.Tan(angleInRadian) - diffYLength); if (denominator
I used to play half life alyx so much that one time I tried to grab the TV remote that was half way across the room like you would do in the game (It didn’t work)
@@ValemTutorialsI know I’m like the 1000th person to say this, but you are literally the best vr game dev TH-camr out there, you somehow always make tutorials about the most niche things that everyone is looking for. I have no idea how you don’t have more subscribers.
Hey Valem, I have been following your tutorials for a bit now but when I test a game in unity it looks fine on my monitor but looks choppy on my quest 2. Any ideas?
I run into a issue with this. If I drop the cube right in front of me and try to pull it back up I get: rigidbody.velocity assign attempt for 'AlyxCube' is not valid. Input velocity is { NaN, NaN, NaN }. UnityEngine.Rigidbody:set_velocity (UnityEngine.Vector3). But this is only when the Cube is directly to my feet and I want to pull it up. It works fine, the moment I step back a little. Do you have any idea why @ValemTutorials ?
I have a suggestion. A hitting tutorial. Setup a 2 hand grab item with a collider that needs to collide with another thing with a certain velocity/force to activate something.
Parent the object to the hand. Should be a function for it in the unity docs. Might need a small custom script to detect when an object has stopped being grabbed, and a filter to decide on what objects to parent when releasing the grab button.
Unbelievable how much crucial content for VR development you provide. And for free. Thanks to you VR platform will keep growing.
Thanks heaps, I requested this tutorial back during the How to make a VR game series from 2022, great to see you go around to it!
Literally everything I know about VR is from you, thank you!
you should do a lightsaber tutorial
thank you, finally a tutorial about the gravity gloves ❤
It works, but if you lift the object right underneath you, you will get an error. So, after messing around, I found that it was related to controller angle relative to surface. If it was bigger than set jump angle, diffXZLength * Mathf.Tan(angleInRadian) would be less than diff.y and you will get negative square root in jumpSpeed, which results to NaN. Here is the fix. Just replace angleInRadian with this.
float angleInRadian = Mathf.Clamp(diff.normalized.y * 90, jumpAngleInDegree, 90) * Mathf.Deg2Rad;
15:10 - it's not a bug, it's a feature.
exactly what I thought :D
I would be interested in seeing a tutorial on an inventory system made with socket interactors. A briefcase or backpack would be cool.
Oh thanks, this tutorial is just in time. Thanks a lot for the video
Very nice tutorial, though I have a problem. When I try to implement ComputeVelocity(), my object suddenly won't budge when flicking my hand. Vector3.Up still works. Does anyone know how to fix this?
Very good tutorial.
can you make this for a gravity gun?
anyone know how he makes his hands disappear when he grabs the cube?
This one is vital
Valem, your tutorial are awesome. Since you have a lot of knowledge I was wondering if you could advice me on how to make a functioning glovebox in VR. So a box with gloves models attached, where you can put hands, and than those gloves should fit to your hands and move around with your hands. Obviously I would also use the hand tracking system from Unity, so no controllers. This sounds really difficult but surely there's a way on how to do this.Maybe with some sort of animations?..Any advice would be very appreciated.
where is yesterdays tutorial?
We'll get a bug if the object is roughly below us. When calculating the jump speed under the root, there will be a negative value, which will accordingly lead to a crash.
it is related to the variable diffXZLength
Same here. I was scrolling the comments for that reason. I made workaround but now it simply just don't move the object when in this position:
float angleInRadian = jumpAngleInDegrees * Mathf.Deg2Rad;
float denominator = 2 * Mathf.Cos(angleInRadian) * Mathf.Cos(angleInRadian) * (diffXZ.magnitude * Mathf.Tan(angleInRadian) - diffYLength);
if (denominator
@@shinzor I think just to attract the object if it is so close, since I could not adequately implement the screed at this distance
Great tutorial! I'd love if you did a new driving tutorial in VR
I used to play half life alyx so much that one time I tried to grab the TV remote that was half way across the room like you would do in the game (It didn’t work)
Aha this is so funny. :D
@@ValemTutorialsI know I’m like the 1000th person to say this, but you are literally the best vr game dev TH-camr out there, you somehow always make tutorials about the most niche things that everyone is looking for. I have no idea how you don’t have more subscribers.
If ur here before 100 views your a legend
Awesome content!
How to do this with hand tracking hands?
Hello, would you please make a quick tutorial on how implement Jump in VR?
can you make a vr rocket launcher where you have to attach the rocket to reload it
I don't know why but everything works but my hands don't grip the cube.
Has anyone had the same problem and was able to solve it?
Hey Valem, I have been following your tutorials for a bit now but when I test a game in unity it looks fine on my monitor but looks choppy on my quest 2. Any ideas?
I run into a issue with this. If I drop the cube right in front of me and try to pull it back up I get: rigidbody.velocity assign attempt for 'AlyxCube' is not valid. Input velocity is { NaN, NaN, NaN }.
UnityEngine.Rigidbody:set_velocity (UnityEngine.Vector3). But this is only when the Cube is directly to my feet and I want to pull it up. It works fine, the moment I step back a little.
Do you have any idea why @ValemTutorials ?
Funny, when I deployed it on quest and I make this "impossible pull" it really breaks the XRrayinteractor.
i'm having the same problem did you fix yours ?
Is it possible to add hand tracking as well?
I have a suggestion. A hitting tutorial. Setup a 2 hand grab item with a collider that needs to collide with another thing with a certain velocity/force to activate something.
Hello. How can I leave grabbale object in hand even when I release grab?)
Parent the object to the hand. Should be a function for it in the unity docs. Might need a small custom script to detect when an object has stopped being grabbed, and a filter to decide on what objects to parent when releasing the grab button.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class rayhalflifeR : XRGrabInteractable
{
protected override void OnSelectEntered(SelectEnterEventArgs args)
{
if (args.interactorObject is XRRayInteractor)
{
trackPosition = false;
trackRotation = false;
throwOnDetach = false;
}
else
{
trackPosition = true;
trackRotation = true;
throwOnDetach = true;
}
base.OnSelectEntered(args);
}
}
oh and change out the name for yours
VALEM I BEG MAKE RAGDOLLS LIKE THAT BALANCE LIKE IN BONE LAB IVE BEEN TRYING FOR MONTHS PLSSSSSS @valem