Bug Fixes

Bug: Collision/Trigger Issues

The issue: some collision behaviour with targets does not work as intended

How to fix:

  • In your robot script, find the OnCollisionEnter() function
  • You should see the first line of the function is:
    • base.OnCollisionEnter(collision);
  • Move (cut) this line of code to the end of the OnCollisionEnter() function
  • Similarly, find the OnTriggerEnter() function and move the first line to the end of that function as well

 

Bug: Error When Accessing enemy Variable

The issue: when accessing the enemy variable from CogsAgent, NullReferenceException is thrown at runtime and the game breaks

How to fix:

  • In the CogsAgent script (under Assets/Scripts), find the Awake() function
  • In Awake(), you should see the following piece of code:

  • Move (cut) this piece of code from the Awake() function and move it to the end of the Start() function of CogsAgent

 

Bug: Unable to Create Build (For Mac)

The issue: on Mac, when creating a build (for the faster training method), a burst compiler exception is thrown and the build cannot be created

How to fix:

  • Upgrade to the most recent 2019 LTS version of Unity:
    • In Unity Hub, under Installs, click on Add
    • Choose the latest 2019 LTS version and install

  • Once installed, under Projects, change the Unity version to the one you just installed and open the game
    • There will be a message stating the project is being upgraded to the new version
    • Once the project is open, try building the project again and it should work now

 

Bug: Laser Not Turning Off

The issue: when the robot’s laser is turned on, it does not turn off, and subsequently prevents the robot from moving

How to fix:

  • Open your script that was renamed from MyGroupName.cs
  • Go to the MovePlayer() function
  • Find the if statement with the comment //shoot and add the else condition as follows:

The code can be copied below:

//shoot
if (shootAxis == 1){
   SetLaser(true);
}
else {
   SetLaser(false);
}

Bug: Close-up Camera Angle Not Working Properly

The issue: close-up camera angles (by pressing 2, 3, or 4) do not work properly

How to fix:

  • Open FinalStageManager.cs (under Assets/Scripts/Setup)
  • In the Start() function, after the cam2.transform.localPosition line, add 2 additional lines of code as follows:

The code can be copied below:

cam1.transform.localRotation = Quaternion.identity;
cam2.transform.localRotation = Quaternion.identity;