Detailed Setup

Quick Tips & Troubleshooting

circle-info

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

Tag Setup

circle-info

Player:

  • Layer of: Ignore Raycast

Any Interactable Object:

  • Tag InteractiveObject or as per the raycast script on the main camera, it will have the tag you need!

FPS Controller usage

circle-info

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

Canvas Group Note

circle-info

The Keycard - Canvas under the Keycard UI Manager > Keycard Inventory Canvas > Inventory Panel - Uses a Canvas Group which has an Alpha or 0 - 1, use this to enable or disable the visual look of the UI elements.

System Setup

Step 1 - Setting The Player

circle-info
  1. Add an FPSController prefab to your scene

    1. Select the Main Camera

  2. You can add the KCInteractor script to either the main camera or the main player object

Step 2 - Adding the Managers

circle-info
  1. Now drag the (from the Prefabs folder into the hierarchy)

    1. KCUIManager

    2. KCAudioManager

    3. KCInventoryManager

Step 3 - UI Manager Setup

circle-info
  1. Select the UI Manager, which will have the KCUIManager script and make sure all the items are connected as below:

All UI objects will be below this parent in the canvas

circle-info
  1. Make sure to add the slots, crosshair and inventory canvas like is under the UIManager object

Step 4 - Inventory Canvas Setup

circle-info

The Keycard Inventory Canvas is under the UI Manager

The system uses a CanvasGroup on the main Canvas object which controls how to show and display the UI. It will fade the canvas in and out.

Step 5 - Setting up the inventory

circle-info
  1. Select the KCInventory

    1. You can set the open inventory key

    2. The key list will be updated when you collect keycards

    3. Use the tickbox to enable saving or not

    4. Use buttons in the saving settings to check on the save file

Step 6 - Setting up the Audio Manager

circle-info
  1. Select the AudioManager and add the ScriptableObjects for sounds you will have created. (The ScriptableObjects folder will have some examples)

Adding Audioclipschevron-right

Step 7 - Creating a Keycard Pickup

circle-info
  1. You can add a keycard from the prefabs folder, all of the details should already be setup but check the details below to make sure.

    1. Tag: InteractiveObject

    2. Add a Box Collider

    3. Add a KCItem script to the object and set the ItemType to Keycard

    4. Add a KCKeyCollectable script and add the appropriate ScriptableObjects and your desired ScriptableObjects audio clip. (Found in the ScriptableObjects folder)

Step 8 - Creating a Scanner with Event

circle-info
  1. You can add a keycard scanner from the prefabs folder, all of the details should already be setup but check the details below to make sure

    1. Tag: InteractiveObject

    2. Make sure to add a Box Collider

    3. Add a KCItem script to the object and set the ItemType to Scanner

    4. Add a KCScannerInteractable script and add the appropriate ScriptableObjects and settings:

Remove Key After Use

Should the key be removed from the inventory after using it with the scanner?

Key Scriptable

Add the key scriptable object that is specific for this scanner

Sounds

Add the sound SO's that are in the screenshot below

Unlock Event

The event which happens when the key is inspired, so in my demo this plays the animation from the STDoorController > OpenDoor script which is on the prefab object.

Last updated