Physics of VR hands in Unity
I am making a boxing game where the player hits specific targets. Each target is equipped with a collider. I look at the velocity of the punch in OnCollisionEnter, and compute damage accordingly. I also want to enable ragdoll mode on enemy death and make the body fly according to the physics of the punch.
Fist: kinematic Rigidbody and Collider with trigger enabled
My Hit Targets received the events fine. I also mistakenly thought that the collider on the fist should have Is Trigger enabled for it to trigger an event on the Hit Target. I was wrong.
As a result of having the Is Trigger enabled on the Fist's Collider, the fist didn't affect other Rigidbodies like it should. So my dummies wouldn't react correctly. Upon death, the dummies would disappear from the view instantly, probably sent out miles away.
Fist: kinematic Rigidbody and Collider with trigger disabled
This works much better. Now the ragdoll animates correctly, even though it flies a bit too far compared to the force of my punch in my opinion. Also, this solution does not require any code, so that's what I settled for.
Fist: non-kinematic Rigidbody and Collider with trigger disabled
This is nice because it forces the fist to react to other Rigidbodies. This means the fist can't go past walls or other objects. The drawback is that since it conflicts with my actual hand position, it gets sent flying as soon as it collides with something.
The trick apparently to get the best of both worlds is to programmatically assign a velocity to the fist to make it follow the hand controller position and rotation, as seen here:
This is nice, especially if you need precise hand physics where the hand should not go through objects. However this is a bit overkill for me since punches are so fast that the user won't be bothered if the punch goes through a dummy.
Interpolate and Collision Detection
The default is None and Discrete. This video recommends to set them to Interpolate and Continuous respectively.
So far I haven't investigated the difference.