- Home /
HTC Vive best place for a body collider?
Im using htc vive with the steam vr prefab, i want to make a player "body" collider, so that the player can be attacked by enemies etc, the collider should move in the room with the real life player body, it should also be able to move up / down if the player jumps. I guess the easiest way would be to make a object with the collider and set a vive object as a parent, but my question is which of the steam object would be the best parent, the "Camera (eye)"? and which height would be good for the collider, since people have different heights and the collider should still be accurate
Answer by mikewarren · May 07, 2018 at 06:23 PM
I'm not familiar with the Steam VR prefab, as I made my own rig.
FWIW, I added a capsule collider to the head/camera node. The XR transform that drives the head/camera position is an offset from the tracking origin, which is usually on the floor. Therefore, the local Y offset of the head/camera is the height of headset from the floor. I use that information to automatically scale the height of the collider to the height of the individual.
$$anonymous$$ind sharing the code to automatically scale the height of the collider based on headset/floor distance?