Last updated
Last updated
VIDEO COMING SOON
How to add a trigger event to for this system?
I'd recommend adding the "SafeSystem_Objects" from the "Prefabs > Individual_Prefabs > Single Objects" section this should include a:
Safe Controller Object
Safe Canvas Object (UI)
Safe Model Object
Safe Trigger Object (If applicable)
Safe_Controller should have a:
"SafeController" script attached
Safe_UI
Safe Model should have a:
"AKItemController" script attached
"SafeItemController" script attached
Box Collider attached
Tag of "InteractiveObject" and layer of "Interact"
The Trigger object or similar with your custom script or the "SafeTrigger"
I have created a basic setup for organising the system, an empty gameobject to hold all of the safe assets:
Safe_Controller
Safe_UI
Safe_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 "SafeController" script attached
You can use the "+" icon to add an event for when you get the correct code, you can add custom interactions if you create a new script with a public method to spawn objects, or some other type of interaction when the safe is opened.
Add this script to a 3D Keypad 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: "SafeSys"
Add a "SafeItemController" script to the object
SafeController variable: Add the connected "Safe_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 “Safe_UI” (In Hierarchy) to find all the elements.
Select any of the "SafeFirstNumberUI" within the "Numbers_BG_Container" and select the child which will be the "FirstArrowUI" (And Similar)
Add an "OnClick()" event (If not already) - Add the "Safe_Controller" to the empty slot and then select the "SafeController" script from the drop down and choose "UpKey" Set it's value to 1. Do the same for the other "ArrowUI's" and then set those to 2 and 3 respectively.
Select the "AcceptKey" UI and add the "Safe_Controller" - Choose the "SafeController" script from the dropdown on the "OnClick" event and select the accept key
Left Click to interact with a safe
Use the "Right Click" Key on each of the safes to exit the safe
Use the "Left Click" Key to interact with the UI indicator
You can change these in the "InputManager"
Safe Model
The "Safe_Model" within this set of gameobjects - Add the 3D object here
Safe Dial
Add the SafeDial GameObject which will be a child of the "Safe_Model"
Safe Animation Name
The name of the safe animation used, default is "SafeDoorOpen"
Safe UI
Add the "Safe_UI" object here
First Number UI:
Choose a combination number between 1-15
Second Number UI:
Choose a combination number between 1-15
Third Number UI:
Choose a combination number between 1-15
Safe Solution Num 1
Add the "SafeFirstNumberUI" from the "Safe_UI" canvas
Safe Solution Num 2
Add the "SafeSecondNumberUI" from the "Safe_UI" canvas
Safe Solution Num 3
Add the "SafeThirdNumberUI" from the "Safe_UI" canvas
Safe Solution Num 1
Add the "FirstArrowUI" from the "Safe_UI" canvas
Safe Solution Num 2
Add the "SecondArrowUI" from the "Safe_UI" canvas
Safe Solution Num 3
Add the "ThirdArrowUI" from the "Safe_UI" canvas
Trigger Event
Add the "Padlock Trigger" which will be a gameobject you create
IsPadlockTrigger
Tick if you're using a Padlock Trigger