Forum Discussion
Sern_Of_Canada
6 years agoHonored Guest
How do you set up crouch detection?
Hey everyone, I'm new to coding for vr and relatively new to Unity too. I'm trying to figure out how to implement crouch detection for a host of game functions such as stealth. I want a bool to trigger true when the player reaches a certain threshold when crouching but I am unsure what the best way of going about it is. So far I have my height in a float and a second float that is 0.6 of that number. I am not really sure where to go from here. Not sure what to track to detect how far the headset is above the ground at any given time either.
2 Replies
Replies have been turned off for this discussion
- MikeFTrusteetrack the Y axis of the head anchor. If the Y value goes below your threshold value, crouch = true
- Sern_Of_CanadaHonored GuestThat should work, thank you!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 1 year agoAnonymous