Elevator buttons need reworking #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the elevator buttons are using a custom-made SpringyButton component. This does not work, because it assumes two trigger colliders (one on the hand, one on the button) can detect each other. Unity does not support this. Only a non-trigger collider entering a trigger collider is what is supported.
But, there is a good solution available. We are using the Unity XR Interaction Toolkit in this project. This includes a XRPushButton class. The car button already uses this. The elevator buttons must use this as well (but with a very small push distance). Basically, an elevator button:
All of the logic of the current SpringyButton as well as detecting collisions between two triggers (that we need for VR hands to interact with buttons and stuff) is all implemented already in the XRPushButton class. Let's use it! :)