VR hand collisions

I am making a VR system, with simple hand and head tracking (already renders the player’s movements in server), and I wanted to make the player be able to interact with physics objects, but it just clips through objects because it’s setting the hands and head’s CFrame every frame.

If anyone knows how I could rewrite the code so it works with collisions, please tell me since I am new to developing in VR.

3 Likes

This may or may not work, but try using Lerp() on the Server, and make sure that the Hands are CanCollide true.

Thanks for the response, I will try that.

In order for this to work, you will need to physically simulate the hands. Don’t do this on the server like sticks said, it will introduce lag and it won’t be great for VR use. Ideally with VR, you should do as much as possible on the client.

I suggest:

  • Make a copy of the hands - these are going to be physically simulated. The “real” hands can be hidden (or don’t, keep them as a debug visualisation)
  • Make the physically simulated hands have CanCollide enabled.
  • Add an AlignPosition and AlignOrientation to the simulated hands, with the Attachment0 properties being set to the “real” hands.

I’ll suggest to not use RigidityEnabled - it can cause objects to freak out when the force is going into the wall. Just set MaxVelocity (or MaxAngularVelocity) to math.huge, Responsiveness to 200 (it’s the max value) and MaxForce (or MaxTorque) to something like 1000-10000. Also try setting Massless on the simulated hands, which will reduce the amount of force needed to move them (the lower the force needed, the better).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.