Комментарии:
The Download Link is filled with empty folders so RIP
ОтветитьI tried this today with a scene I made following your 3 part quest 3 MR Tutorial and the OVRCameraRig hierarchy used there is so different that I couldn’t get it working , I tried to copy this and adapt where I could but utilise didn’t work. Could you add part 4 to the mixed really tutorial where you can pick up and throw the red balls? Or maybe you gave some quick advice? Thanks
Ответитьhi! thanks amazing tutorial, but if I have controller in the project and want to hide or alternate btw hands and controller how can I do?
ОтветитьHey valem. is it possible to combine this with two bone ik? i dont want to judt put a rigid body and collider on the target and move the target because the colliders on the hands are more accurate
Ответитьthis worked so well, thank you. I really like how you put so much time into this.
Ответитьhi would this work for bows arrows climbing
ОтветитьI have a problem with the hands, when I rotate them, at some point they do a strange rotation to return to the original, what can I do?
Ответитьi found a far better and simpler way than the Valem tutorial. simply add collision handlers to the Pusher objects under each hand like this
Code (CSharp):
public class HandCollision : MonoBehaviour
{
[SerializeField] private GameObject _thisHandModel;
public void OnCollisionEnter(Collision collision)
{
if(collision.collider.gameObject.layer != 0)
{
return;
}
if (collision.collider.transform.GetComponent<XRGrabInteractable>())
return;
_thisHandModel.transform.parent = null;
}
public void OnCollisionExit(Collision collision)
{
if (collision.collider.gameObject.layer != 0)
{
return;
}
_thisHandModel.transform.position = transform.parent.position;
_thisHandModel.transform.rotation = transform.parent.rotation;
_thisHandModel.transform.parent = transform.parent;
}
}
then pass the hand model of the hand you are in in the inspector
it simply unparents the model from the controller when it hits a collider (on the default layer) and when it exits, it reparent to the controller, super simple
Great vid! I used a quest 2, and it worked, HOWEVER!- there is a problem, in the game if I rotate my hands a bit fast, than i will see my hands slooowly rotate to the real place of my hands...
ОтветитьHandPresencePhysics script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HandPresencePhysics : MonoBehaviour
{
public Transform target;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
rb.velocity = (target.position - transform.position) / Time.fixedDeltaTime;
Quaternion rotationDifference = target.rotation * Quaternion.Inverse(transform.rotation);
rotationDifference.ToAngleAxis(out float angleInDegree, out Vector3 rotationAxis);
Vector3 rotationDifferenceInDegree = angleInDegree * rotationAxis;
rb.angularVelocity = (rotationDifferenceInDegree * Mathf.Deg2Rad / Time.fixedDeltaTime);
}
}
adding the hands in but they pink
ОтветитьHi,
For me this is working with controllers only. How can it work with Hands?
The rotation is still messed up for me, how do i fix this?
Ответить@Valem Tutorials will this be able to work with the oculus hands just like the HPTK video you did?
Ответитьi have a problem my hands do not align to the rotation of the controler its 90* off in both directions
Ответитьhey
Ответитьevery single game dev tutorial turns into coding
if you wanna make a game, go learn how to code. apparently learning unity is the easiest part.
Hello: I have been trying to follow your tutorial but using Action Based Controller as opposed to Device Based. All works well with Device based but can't get Physics hands to track using Action based controller. Any thoughts? Thanks
ОтветитьHi, for anyone having problems with the hand rotating uncontrolled here is a solution:
Quaternion rotationDifference = target.rotation * Quaternion.Inverse(transform.rotation);
rotationDifference.ToAngleAxis(out float angleInDegree, out Vector3 r);
if (float.IsInfinity(r.x))
return;
if (angleInDegree> 180f)
angleInDegree-= 360f;
// Here I drop down to 0.9f times the desired movement,
// since we'd rather undershoot and ease into the correct angle
// than overshoot and oscillate around it in the event of errors.
Vector3 angular = (0.9f * Mathf.Deg2Rad * angleInDegree/ Time.fixedDeltaTime) * r.normalized;
This solved the weird behavior for me, solution is not mine it's from gamedev stackexchange
my brain is rock idiot this is the first game I ever made it looks shit but it is going to work
ОтветитьI NEED HELP!! My object (currently a sphere not a hand) has its ridged body work properly but it looks like it foes through the block. I dont think that the mesh is binded to the ridged body or something
Ответитьusing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Handphysics : MonoBehaviour
{
public Transform target;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = getcomponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
rb.velocity = (target.position - Transform.position) / time.fixedDeltatime;
{
}
}
Very good video, I have done what you say, but my hands keep going through the objects, why?
ОтветитьBoth of these videos were super helpful and worked for me almost a year later. Thank you, Valem!! If anyone is using a Character Controller (which has a collider) on their XR Origin, you might notice your hands are hitting the invisible collider. I fixed this by putting the XR Origin on its own layer ("Player") and went to Edit > Project Settings > Physics, and under the Layer Collision Matrix, unchecked "Player" from both of the Left and Right Hand Physics.
ОтветитьWhen adding the hands with all the colliders and building the app to the Quest 2 I get a lot of performance issues when interacting with different objects. Do you have any tips on how to improve performance but still have nice physics? Great tutorials btw, I love your content.
ОтветитьHI love all your videos excellent work as always .. I seem to have a problem I've followed everything perfectly but I still seem to have 2 sets of hands when I grip I can still see the old static hands. I did uncheck them but can't seem to remove them?
Ответитьhello, i ahave a problem. you are not explaining in this tutorial which setup of XR you have. i am currently working with the oculus Asset and using a "oculusinteractionsamplerig" and you the XR interaction manager + xr origign, and i am still trying to figure out to apply this. other than that i love how you explain.
Ответитьwhy does nobody add a point animation to their hands? Is essential in vr no? when you need to press button
ОтветитьExcuse me. Does it work if I use the Action-based XR Controller? Because I did step by step but the hands model did't follow the hands controller.
Ответитьim having a problem where the vr hands are spinning the wrong way to get to the original position
ОтветитьThanks! Proper XR breast fondling here I come!
ОтветитьHey Valem, does the mesh collider works stead of using capsule colliders? ty
ОтветитьBomboclat
ОтветитьValem, this needs to stop. I just found out you now have a fourth series on this topic.
Which one do I follow? Which one is correct? Why do they reference eachother? Why!???!? I just want to make epic hentai VR game.
I've had issues with this angular velocity code causing errors that read out as "Input velocity is Vector {NaN, NaN, NaN}". Anyone else had something like that and maybe a solution? It doesn't seem to cause any actual gameplay issues but it is annoying
ОтветитьIs there a way to smooth the rotations of the hand? It's really snappy and jittery.
ОтветитьHello, does this behaviour happen to anyone: the physics hands were stuck/blocked by objects like walls when teleporting to a different location?
ОтветитьHi so is the oculus hands physics package open source? Can I use it in my own, non-oculus Unity XR project? Who made the package?
ОтветитьHey, thanks for your tutorial, the collision with non rigidbody object seems to works perfectly fine, the only thing is that my hand are spining like crazy when I set them to non kinematic, even if I made the script, I added the script as a component to them and I correctly set the target. I'm kinda lost, I followed exactly the tutorial.
ОтветитьHuge thanks for making those content!!
Ответитьcan somebody tell me what´s wrong with my code?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HandPresencePhysics : MonoBehaviour
{
public Transform target;
private Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
rb.velocity = (target.position - transform.position) / Time.fixedDeltaTime;
Quaternion rotationDifference = target.rotation * Quaternion.Inverse(transform.rotation);
rotationDifference.ToAngleAxis(out float angleInDegree, out Vector3 rotationAxis);
Vector3 rotationDifference = angleInDegree * rotationAxis;
rb.angularVelocity = (rotationDifferenceInDegree * Mathf.Deg2Rad / Time.fixedDeltaTime);
}
}
because unity always says: ''The name 'rotationDifferenceInDegree' does not exist in the current context''
and ''A local variable or function named 'rotationDifference' is already defined in this scope''
hi can i have some help after i drag the hand with collider to hand pysics animation script its not making the hand with the collider animate
ОтветитьHm but when you walk they are moving weirdly. lagging...
Ответитьi fixed the wrong axis hands with this:
Quaternion postRotation = transform.rotation * Quaternion.Euler(0, 0, -90);
Quaternion rotationDifference = target.rotation * Quaternion.Inverse(postRotation);
merci!
Ответитьwhen using the Hands prefab with Colliders the animations don't work, Animator is not playing an AnimatorController, but in fact it's equal to the prefab without Colliders, and they actually work, dunno
Ответить@Valem Tutorials I copied your video exactly and I am on 2021.3 something but at the end of the video when I pick up a object my hands start rotating a lot. Could you pls help me fix this.
Ответить