Allan Didier

GD 2D Game Kit Troubleshooting

Unity WindowThe 2D Game Kit can have issues with various things. The following pages have directions on how to fix broken things in the 2D Game Kit

Ellen's Heart Health UI

If Ellen’s hearts in the UI are not updating when she takes damage, follow these steps to fix it. You have have to fix it on every new level you create. 

  1. Select Ellen in the Hierarchy
  2. Select her “Damagable” script in the Inspector
  3. in the “On Health Set (Damageable)” area,
    1. Click where it says “<Missing HealthUISetInitial>”
    2. Change this to
      1. HealthUI
      2. ChangeHitPointUI (Damageable)
    3. Select Ellen as the damagable object or drag her from the Hierarchy into the damagable object slot. 

Ellen's Chest Light

If the game is dark and Ellen only has a small spot light around her when the game plays, you can modify the lighting settings with the directions below. 

  1. Select Ellen in the Hierarchy
  2. Expand Ellen in the Hierarchy by clicking the little triangle just left of her name.
  3. Select the “Chest Light” in the Hierarchy under Ellen
  4. In the Inspector, look at the “Light” section of the Chest Light.
    1. Change the “Type” pull-down menu from “Point” to “Global” to turn the light on full. 
    2. If you want to keep the spotlight but make it larger, change the Range or Color options. 

Spike and Teleporter Graphics Showing Pink

In versions of Unity, the graphics in the 2D Game Kit get messed up. The 2D Game Kit was created a few years ago (2019) and newer versions of Unity handle graphics a little differently. Follow these steps to get the Pink graphics to show properly. 

  1. In the Project Tab, go this folder: 2DGameKit / Art / Materials / Interactables
  2. Select the Spikes Material
    1. Inspector panel
    2. Shader tab
    3. Change Shader drop down menu to: Standard
  3. Select the Teleporter material (you have to do this one material at a time).
    1. Inspector panel
    2. Shader tab
    3. Change Shader drop down menu to: Standard
  4. Back to the Project Window
  5. Select both the Spikes and Teleporter Materials (use Command-select to select multiple files or do them one at a time).
    1. Choose Edit-Rendering-Materials-Convert Selected Built-in Materials to URP

Teleporter Not Teleporting to Another Scene

Do the following to fix a teleporter not working to teleport from Level 1 to Level 2.

  1. Open File-Build Settings
  2. Delete all of the scenes in the scene view
    1. Right-click on them and Remove Scene.
    2. Remove even your scenes.
  3. After all scenes are removed, add your two scenes back. If it won’t add multiple scenes at one time, you may have to open your scenes one a time and choose Add Open Scene. 
  4. Go back to the Transition Start object and your other level should show up as a new scene.

Random Crashing: -force-metal

If the 2D Game Kit is randomly crashing a couple of times per class, try this fix. Sometimes the metal textures (on doors and the teleporters) are not shown properly on the Mac and cause Unity to crash.

  1. Quit Unity
  2. Go to Unity Hub
  3. Click on the 3 dots next to your project on the right. Do not open your project.
  4. Choose “add command line arguments”
  5. Add the following line to the box (copy and paste it):  -force-metal
  6. Save and reopen your project. 
  7. Let Mr. Didier know if it keeps crashing.

Dialog Text Windows Not Showing Up Properly

  1. Delete the TextMesh Pro Asset from Assets/Utilities/TextMesh Pro
  2. Add Cinemachine from the WIndows packages, Window->Package Manager or from the Asset Store window.
  3. Menu bar, Edit->Project Settings->Editor, in 
    1. Version Control choose Mode->Visible Meta files
    2. Asset Serialization->Force Text
  4. Menu bar, Window->TextMesh Pro->Import TMP Essential Resources
  5. Finally, Window->TextMesh Pro->Project Files GUID Remapping Tools
    1. Remap all files that show up.

Getting the 2D Game Kit to Install

  1. Add 2d Game Kit to my assets in Asset store
    1. In a web browser, go to unity asset store.
    2. Log in to asset store with student (your) account
    3. Search for 2D Game Kit
    4. Add it to my assets
  2. In Unity Hub
    1. Create a new 2D project. This project will be trashed later and we won’t use it. 
      1. The 2D GameKit does not import properly into an existing project and needs a new project. 
    2. Open the project in Unity
  3. In Unity 
    1. Go to Window-Package Manager.
    2. Change “Packages”” (Top left) to My Assets drop down menu.
    3. Download the 2D Game Kit
    4. Import the 2D Game Kit
    5. When asked, choose “Switch Project”
    6. This will close the old project and open a new project with a functional 2DGK. You will know the 2D Game Kit is working if you see Ellen in the screen to the right and the Kit Tools pull-down-menu works.
    7. Save the project
      1. Once you know the 2D Game Kit loaded properly, you need to save it. Don’t save it the normal way or else you may not be able to find it again.
      2. Close Unity. 
      3. This will prompt Unity to ask you to keep the project
      4. Save it in the Documents folder. By default it is buried in a temp folder that you won’t be able to find.
  4. Back to Unity Hub. Since you save a project behind Unity Hub’s back, you need to tell Unity Hub about your new project. 
    1. Choose “Add” then “Project from Disk”
    2. Find the new game folder
    3. Open it.