#NaAquelo's physics thread

1 messages · Page 1 of 1 (latest)

earnest solar
#

Here now you have a thread @honest wing

honest wing
#

I'll explain a bit more. I'm trying to create my own custom interaction toolkit for a VR game that I'm working on. So far I have a Interactor and a Interactable class which are applied to a player's hands and grabbable objects respectively. When a player grabs an object I create a InteractionInfo object which stores some useful information about the position and rotation of the grab https://pastebin.com/bVZx6tnC. Then during every FixedUpdate call inside the Interactable class I update the position and rotation accordingly https://pastebin.com/wb7D0qC8. My problem is that there is a pretty noticeable delay when the objects tries to track the Interactor's position and there is also a considerable amount of jitter whether the Interactor is moving or not and then finally when an Interactor grabs onto an object with a HingeJoint component like a door or a lever then the object freaks out and jitters between the Interactor's hand and rotation and the joint's position and rotation which I was told wouldn't happen if I use MovePosition and MoveRotation on the rigidbody. I've tried other things as well like ``` _rigidbody.velocity *= (-1 * _dampenFactor);

  Vector3 velcoity = (targetPos - transform.position) / Time.deltaTime;
  _ridigbody.velocity += (velocity * _scalingFactor);``` instead of `MovePosition` inside the FixedUpdate method however this just makes things worse but ends up giving me the same result as `MovePosition` if I put it inside the `Update` or `LateUpdate` method.