Debug Events

Introduction

Debug events are essential for identifying and resolving issues that may arise after your game has been released. These events help notify your team when exceptions occur and track arbitrary data points to ensure the game functions as expected. Debug events can be particularly useful during development and for tracking issues that are not consistently reproducible in testing.

Events

DebugEvent

Use this event to capture debug messages. These can be exception messages or any arbitrary strings that help in tracking the behavior of your game.

  • You can use a DebugEvent to track possible cheaters in your game. If there is a certain area in your game you know the user shouldn’t be able to access yet, or if you have other conditions that you know a player shouldn’t be able to meet, you can use a DebugEvent to track that information.

ErrorEvent

Use this event to capture error messages, categorized by their severity. This helps in identifying and prioritizing issues based on their impact on the game.

  • You can use ErrorEvent as part of a global exception-handling framework in your game. Rather than writing try/catch blocks throughout your code to catch unhandled exceptions, Unity supports a global exception handler, which is a single function that can be called any time an exception is thrown in your game and isn’t handled. You can then track these exceptions in one place and fire an ErrorEvent whenever they occur, giving you insight into overall health and performance of your game.