I just pushed out a package for a simple UI based keypad that allows you to toggle a 9 digit keypad on the user entity.
How to use
- Download the “User Keypad” package
- Attach the script folder template that comes with it to the user entity
- Place an instance of the template “KeyPadTrigger” in the world
- Update the properties on this trigger to the required code and results (see below for more information). Note that you can place multiple instances of this trigger
The code is configured by adding the number to an array. The default comes with 4 elements in the array which are 1, 2, 3 and 4. You can increase or decrease the number of elements in the array to adjust the length of the code needed by the players.
This is the event that will trigger if the code is successfully entered.
Once the players have entered enough digits for a full attempt the code will determine if they’ve entered the code correctly. I.e., if the keypad requires is a 6 digit code then the script will check once the player has entered 6 digits into the pad. If they are correct, the keypad will close and the event will trigger. If they are wrong then the selected digits will reset and a sound plays accordingly.
You can find an example of how this works here : Crayta
This is a simple example of how the keypad can be used to open a door.
Any feedback or suggestions would be appreciated!