Detailed Setup

Quick Tips & Troubleshooting

QUICK START: You can add the Padlock Demo Scene Prefab to your scene to get everything setup and ready to go without having to follow any extra steps.

Layer Setup

CREATE LAYER: Create a Layer in the top right of the Unity Inspector called PadlockSpinner

FPS Controller usage

When starting your new project you'll need to use a character controller you wish - I have included my STFPSController for ease of use

System Setup

Step 1 - Check the Padlock Prefab Spinner Layer

  1. Open the Padlock Spawnable objects from the prefabs folder and each spinner should be setup as below

    1. Padlock Spinner Setup:

      1. Make sure to add the PadlockNumberSelector script – Set the row according to it’s row

      2. Box Collider

      3. Rigidbody

      4. Set the Layer to PadlockSpinner (Make sure to create a Layer in the top right of the inspector called PadlockSpinner)

Step 2 - Player Setup

  1. Add the FPSController prefab from the prefabs folder to your scene. (You can drag this into the hierarchy or the main scene.)

    1. Set the FPSControllers layer to Ignore Raycast if you're having interaction issues with player colliders blocking the way

  2. Main Camera Settings (Parented to the FPSController object)

    • Add the PadlockInteractor (If not already).

    • Set the tag to MainCamera

    • Add a Physics Raycaster

      • Set the EventMask to PadlockSpinner

Step 3 - Setting Up Trigger or Raycast Versions

  1. Add PadlockTrigger / Padlock Raycast sets to your hierarchy or scene from the assets Prefabs folder. Add this asset wherever you want in your scene.

  1. Make sure your Padlock Interactable GameObject has

    1. Box Collider

    2. PadlockItem script - Add the controller GameObject here (See below)

Step 4 - Padlock Controller Setup

  1. Select Padlock Controller object if not already added from the combined prefabs to your project, which will have the PadlockController script added

NOTE: Read through the information below and attach the correct GameObjects in the PadlockController script in the inspector. See the image on the next page for more details

Type
Description

Your Combination

This is the code order you wish to open the padlock. 4 digits (1-9) only.

InteractableLock

Add the Padlock_Interactable object to this slot

Prefab To Spawn

This is the prefab from the spawnable prefabs folder that you wish to spawn in front of the camera

Distance From Camera

How far the padlock should spawn away from your camera

Animation Name

The animation name to play when opening the lock

Audio Names

The ScriptableObjects for all audio effects

isPadlockTrigger

Only tick this if you’re using a trigger event and have filled the above slot.

Trigger Object

Added your trigger event which would have the script PadlockTrigger

Unlock Event

You can add a gameobject with a script you want to activate when you get the code correct.

Step 5 - Disable Manager Setup

  1. Drag a DisableManager - From the prefabs folder and you can start by adding new events for when the player should be enabled or disabled, see more inforomation on the page below.

Disable Manager Explained

Step 6 - Audio Manager Setup

AudioManager - Add all of the appropriate ScriptableObject audio effects from the scriptableobjects folder

Setup 7 - Setup UI Manager

UIManager - This UI manager will have the canvas for all UI elements parented and you should add the correct UI elements to the slots in the manager.

Last updated

Was this helpful?