Phone Sys - Setup
Last updated
Last updated
How to add a trigger event to for this system?
I'd recommend adding the "Phone_Objects" from the "Prefabs > Individual_Prefabs > Single Objects" section this should include a:
Phone Canvas Object
Phone Controller Object
Phone Model Object
Phone_Controller should have a:
"PhonePadKeyController" script attached
"PhonePadController" script attached
Phone_Canvas
Phone Model should have a:
"AKItemController" script attached with "PhoneSys"
"PhonePadItemController" script attached
"Box Collider" attached
Tag of "InteractiveObject" and layer of "Interact"
I have created a basic setup for organising the system, an empty gameobject to hold all of the keypad assets:
Phone_Controller
Phone_Canvas
Phone_Model
This object should be an empty GameObject and it will control everything that goes on for your flashlight system!
Make sure this object has a "PhonePadKeyController" and a "PhonePadController" script with custom settings!
Character Lim | The amount of characters in your code |
Phone Code | The InputField from the Keypad Canvas |
Phone Clip | The entire Keypad Canvas from the associated object |
Trigger Event | Add the "Padlock Trigger" which will be a gameobject you create |
IsPadlockTrigger | Tick if you're using a Padlock Trigger |
Add this script to a 3D Phone model from the prefabs or one you may have created yourself
Make sure your object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the System Type to: "PhoneSys"
Add a "PhonepadItemController" script to the object
KeypadController variable: Add the connected "Phone_Controller" object
NOTE: This only needs to be done if you’re setting the canvas buttons yourself or if anything might be missing.
Select and open out your “KeypadCanvas” (In Hierarchy) to find all the elements.
Select any of the Button numbers, add an “OnClick()” event in the bottom right of the inspector by clicking the “+”. (Unless it already has one added, image below).
Add your “PhonePadController” object to the available slot (This will link the keycontroller script which exists on that object).
On the drop down on the right, (No function dropdown if nothing is selected) choose the “KeyController” option which will open out into more.
Choose “KeyController.KeyPressString”
You can then add whatever number or keyboard symbol you like in the slot below the dropdown. Continue this for each button available.
NOTE: Similar setup for the CLOSE / CLEAR / ENTER Button.
Select any of the input keys, add an “OnClick()” event in the bottom right of the inspector by clicking the “+”.
Add your “KeyPadController” to the available slot
On the drop down on the right, choose the “KeyController” option which will open out into more. Choose “KeyController.KeyPressClose” or “KeyController.KeyPressClr” or “KeyController.KeyPress.Ent” to the corresponding buttons.
Left Click to interact with a pickup
Use the "Esc" Key on each of the keypads to exit the keypad
You can change these in the "InputManager"