Detailed Setup
Quick Tips & Troubleshooting
QUICK START: You can add the Entire_Keypad_DemoScene to your scene and it will have all the keypad system setup and ready to use
TextMeshPro Required
Please note that TMP will appear as a popup if not installed in your project
Click Import TMP Essentials to use the system fully
Tags Reference Guide
Raycast:
3D keypad / phone model should be tagged: Keypad
Trigger:
3D keypad model should be set to: Untagged
FPSController should be tagged: Player
System Setup
Step 1 - Player Setup
Place the FPSController prefab in your scene from the Prefabs folder
Set the FPSController object to the tag of Player
On the MainCamera – Attach CodeDeviceInteractor Script. (If not already).
CodeDeviceInteractor Settings:
Set the InteractDistance (Default: 5)
Set the DeviceTag (Default: CodeDevice)
Set the InputKey (Default: E - Uses the older input system)
Step 2 - UI Manager Setup
Add the UIManager object into the hierarchy and add the following references
Keypad Input Fields (CodeText)
Add out of the UI - Type - InputFields from the children below
Canvas References
Add the canvas' to the correct slot
Raycast Interact Prompt
Add the UI - InteractPrompt from the child below
Trigger Interact Prompt
Add the UI
Crosshair
Add the UI
Persist Across Scenes
Tick this box if you want this manager to stay between scenes
UI Manager Objects
Step 3 - Keypad Audio Manager
Add ONE Audio Manager to the hierarchy
Add the ScriptableObjects named
If you need more help on creating new audio ScriptableObjects:
Step 4 - Disable Manager
Click the "+" on either the OnPlayerDisabled() or OnPlayerEnabled() to add new events
I disable the FirstPersonController script by selecting the FirstPersonController > Bool Enabled
I disable the CodeDeviceInteractor when the player is disabled
I actually enable the CodeDeviceUIManager.ShowCrosshair
Step 5 - Setting up 3D Keypad Model
Open any of the Raycast or Trigger keypad collections and find the Keypad 3D model
Set tag: DeviceCode (If using for a FirstPerson setup)
Has the DeviceCodeItem script attached with the controller added to the slot
Has a Box Collider
Step 6 - Keypad / Phone Controller Setup
Add a Keypad / Phone controller to any empty gameobject or similar
Take a look at the Controller script for that set of objects - See settings below
Keypad Type
Choose: Modern, Scifi, Keyboard, Bomb
Input Limit
Set character limit, based on the code you’ve just chosen
Code List
Set the array size to add more code options
Inside each option is a Codes to set the code you would like player to input
Then an event to activate when this code is input into the keypad
Closing Input
This is the input used to close the keypad
Keypad Interaction Sounds
Add the ScriptableObject objects from the corresponding folder
Keypad Input Sounds
Add the ScriptableObject objects from the corresponding folder
Trigger Event
Set whether this is a trigger event version by selecting the check box, if true. You will get another option to add the trigger object
Step 7 - Unlock Event:
Click the + icon in the bottom right, it will add a new event and you can place any gameobject which may have a script with a public method you want to call.
In this case I have added the door object, this has a script called DoorController which has a public method called OpenDoor
You can then run this code each time you unlock something, this can be changed on each door, and multiple events can happen in each
Last updated