Getting Started

To get started with the Game Mechanics Library you will need to:

  1. Create a new Unity project
  2. Download the mechanics
  3. Install the new Input System
  4. Add the necessary layers

 

Downloading the Mechanics

If you can, it is highly recommended to download the Unity Template for the Mechanics Library. It will automatically do all the steps below so you don’t need to worry about them. You will need to add it to your templates folder, which is usually located at C:\Program Files\Unity\Hub\Editor\2022.3.4f1\Editor\Data\Resources\PackageManager\ProjectTemplates on Windows. Then just create your project with the library template from Unity Hub.

If that isn’t possible, a package is provided below:

WARNING: IMPORTING THE MECHANICS LIBRARY PACKAGE INTO A PROJECT WILL OVERWRITE SCENES AND FILES BY DEFAULT. BACK UP ALL WORK BEFORE IMPORTING A NEW VERSION OF THE LIBRARY. To not have it overwrite individual assets, uncheck them when importing – though this is not officially supported, especially with scripts since some may rely on others.

Download the Game Mechanics Library Package here.

This package comes with all of the assets featured in the whiteboxes on this site. Feel free to delete any extra materials, textures, prefabs, models, and scenes you won’t be using. However, be careful to keep all scripts. Some mechanics implement special behavior to be compatible with others and if they can’t find another script, they may not work even if you’re not using that script in your game.

 

Installing the new Input System

Unity has a new Input System package that makes things a lot easier to fine tune!

Open the Unity Package Manager

Set the package search to “Unity Registry”

Search “input” to find the new Input System

Click Install! If it asks you to reload backends, say yes and wait for unity to restart. If you accidentally selected no, just restart unity.

 

Adding Layers

Layers help with certain interactions by letting us sort game objects into groups. The mechanics library uses a few layers for interactions like detecting climbable walls or whether or not a game object is part of the character.

You’ll need to add these layers if you want to play around with the whiteboxes, since unity doesn’t let us export the layers into a package.

1. Select any game object in your project

2. Select its layer in the inspector, and click “Add Layer…” at the bottom of the context menu

 

3. Add these layers at these positions: Character – Layer 3, ClimbableWall – Layer 6, GrapplePullPoint – Layer 7, GrappleToPoint – Layer 8

4. You’re done! Feel free to add your own layers as you see fit.