> For the complete documentation index, see [llms.txt](https://speedtutoruk.gitbook.io/adventure-puzzle-kit-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://speedtutoruk.gitbook.io/adventure-puzzle-kit-doc/getting-started/ak-item-setups/safe-sys-setup.md).

# Safe Sys - Setup

## Safe System - Video Setup

{% hint style="warning" %}
VIDEO COMING SOON
{% endhint %}

## Safe Controller Main Setup

{% hint style="warning" %}
How to add a trigger event to for this system?
{% endhint %}

{% content-ref url="/pages/-MB9giTZuVPnpZlpWP4w" %}
[Broken mention](broken://pages/-MB9giTZuVPnpZlpWP4w)
{% endcontent-ref %}

## Basic Steps

{% hint style="info" %}

1. I'd recommend adding the "**SafeSystem\_Objects**" from the "**Prefabs > Individual\_Prefabs > Single Objects**" section this should include a:
   1. Safe Controller Object
   2. Safe Canvas Object (UI)
   3. Safe Model Object
   4. Safe Trigger Object (If applicable)
2. Safe\_Controller should have a:
   1. "**SafeController**" script attached
3. Safe\_UI
4. Safe Model should have a:
   1. "**AKItemController**" script attached
   2. "**SafeItemController**" script attached
   3. Box Collider attached
   4. Tag of "**InteractiveObject**" and layer of "**Interact**"
5. The Trigger object or similar with your custom script or the "**SafeTrigger**"
   {% endhint %}

## Safe Objects Setup

{% hint style="warning" %}

* 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
    {% endhint %}

![](https://1990716438-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB9gFa1PG62oL0UGY7U%2F-MLiwQj-HeUR5u6xT7T_%2F-MLiyeLI9m9ydxSYY6Xx%2FSafe_Objects.JPG?alt=media\&token=c50c99c5-2515-484f-955a-28115940629c)

## Safe Controller Setup

{% hint style="info" %}
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
{% endhint %}

![](https://1990716438-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB9gFa1PG62oL0UGY7U%2F-MLiwQj-HeUR5u6xT7T_%2F-MLiysyZvuwHGDdjGLHM%2FSafeController.JPG?alt=media\&token=3b949ed6-c8e0-4a42-a3ad-964a969a31da)

#### Safe Model References:

| 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"    |

#### Animation References:

| Safe Animation Name | The name of the safe animation used, default is "SafeDoorOpen" |
| ------------------- | -------------------------------------------------------------- |

#### Safe UI:

| Safe UI | Add the "Safe\_UI" object here |
| ------- | ------------------------------ |

#### Safe Solution 0-15:

| 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 |

#### UI Numbers:

| 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  |

#### UI Arrows:

| 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 Type - ONLY If using a trigger event:

| Trigger Event    | Add the "Padlock Trigger" which will be a gameobject you create |
| ---------------- | --------------------------------------------------------------- |
| IsPadlockTrigger | Tick if you're using a Padlock Trigger                          |

#### Unlock Events:

{% hint style="info" %}
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.&#x20;
{% endhint %}

## Safe Model Item Controller

{% hint style="info" %}
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
    {% endhint %}

![](https://1990716438-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB9gFa1PG62oL0UGY7U%2F-MLiwQj-HeUR5u6xT7T_%2F-MLj-x2sl1RqVJKe9pBW%2FSafeModel.JPG?alt=media\&token=409cec3a-0362-4e3e-a45b-e0b18d20c8ec)

## Safe - Canvas Setup

{% hint style="warning" %}

NOTE: This only needs to be done if you’re setting the canvas buttons yourself or if anything might be missing.
{% endhint %}

{% hint style="info" %}
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)&#x20;

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.&#x20;

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
{% endhint %}

![](https://1990716438-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MB9gFa1PG62oL0UGY7U%2F-MLiwQj-HeUR5u6xT7T_%2F-MLj12hvYuOZH6wCUMcT%2FSafeUI.JPG?alt=media\&token=9166f465-7985-482e-8a10-a6b63369a3fb)

## Default Controls

{% hint style="info" %}

* **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**"
{% endhint %}
