How To Create a Key

Creating Key ScriptableObject:

  • You can create a ScriptableObject by righting click the hierarchy and creating a Key object

    • Key Name: Add the keys name here

    • Key Sprite: Add the sprite to use for the key object

Creating Key Collectable:

  • Add a 3D object of a key to your scene and make sure it is setup as below:

    • Box Collider

    • Door Item script

      • Set the DoorType to Key

    • Key Collectable script

      • KeyScriptable: Add the relevant ScriptableObject to this slot

      • PickupSound: Add a pickup sound of your choice

Last updated