Locks and Keys Package

Locks and Keys

by Mafloce

Overview

This package adds doors that can be unlocked with keys to your game. You can place as many doors for each key as you like, and it will become possible to unlock once the key has been collected. There are three types of keys: a key for wooden doors, a keycard reader for futuristic doors, and a statue to unlock the temple door. When the player has a key, a UI element will show which key they have, and that UI element will disappear once they have unlocked all the doors that the key works for.

Images

Installation

Installing Locks and Keys
  1. Search Locks and Keys on the community tab and install it into your game
  2. Go to the Library tab and drag the LKPlayerTemplate and the Player Interact Prompt script folders onto the player template
  3. Drag the door templates and the corresponding keys into your game.
Which Doors for which keys?

Wooden Doors: LKDoorWood, LKDoorWood2, LLDoorWoodTrapdoor
Wooden Key: LKKeyWood
Temple Door LKDoorTemple
Temple Key (statue) LKKeyTemple
Space Doors LKDoorSpace, LKDoorSpaceAirlock
Space Key (keycard) LKKeySpace

Important Note: Only have one of each type of key in the world.

How it works

Each door will be automatically detected when you put them in. This means you don’t need to change anything to have doors that have keys to unlock them. Additionally, the keys are shared between players, making this work well on collaborative games. When a player picks up a key, all doors that key controls become possible to unlock.

This package uses the Interact Prompt Package to display prompt to tell the player if the door is locked, and show prompts when they can unlock it.

All the doors have sound effects included, although feel free to change the mesh of the doors to add more varieties to your own game.