The Keypad Prefab is a versatile and easy-to-use Unity solution for creators for incorporating a keypad-protected area into your virtual environment, you can restrict access to specific users, such as Patreon supporters, club members, or private rooms. Additionally, this feature can be integrated into VR games to provide an engaging gameplay element, challenging players to discover the required passcodes to progress.
Installation #
To utilize the Keypad Prefab, begin by installing UdonSharp API. This will not require further intervention. Next, download and install the latest version of UdonKeypad. After both installations are complete, drag the Keypad prefab into your world, click on it, and click “Compile All From Sources.” For assistance with any issues, consult the available Discord server.
Basic Setup #
After installing UdonSharp and Keypad, you can easily configure the prefab to suit your needs. The primary settings are “Door Object,” which accepts any GameObject that will toggle its active status based on the passcode, and “Solution,” which accepts a numeric passcode up to 8 numbers long. You can also create “Allow List” and “Deny List” user groups to manage access based on usernames, regardless of the entered code.
If your project requires additional passcodes or multiple door objects, use the “Additional Solutions” and “Additional Door Objects” settings. To uniquely pair a specific solution with a particular door, enable the “Key Separation” mode.
Customization #
The Keypad Prefab offers various customization options, such as translating the interface into different languages, adjusting status text, and modifying door behaviours. You can disable debugging for a less verbose console, but it is generally recommended to leave it enabled. Further customization, including changing button values or design, can be achieved using Unity assets.
Advanced Solution Scripting (Optional)
For creators interested in Udon programming, advanced scripting options are available. Three custom event-based programs can be utilized for success, failure, and reset states. The optional variable keypad code can be set within the target program to store the entered code. Note that this feature is recommended only for users with experience in Udon programming.
The Keypad Prefab is a powerful and adaptable tool for VR creators, providing an efficient way to manage access and security within VRChat worlds. No credit is required for its use; however, sharing screenshots of your implementation is highly encouraged to motivate ongoing improvements and updates. Enjoy creating secure and interactive virtual spaces with this valuable asset.