In-game Console

The last few days I’ve been working on an in-game console. Because I was testing the multiplayer capabilties of Unity and couldn’t be bothered to make 2 separate projects for the client and server to test it, I needed a simple console that would allow me to easily check the errors, warnings and logs that occurred during runtime. And then it got a bit of feature creep that turned it into a full blown console with support for custom commands and scene queries. It also is able to call any method on components in the scene.

The console in action

Current working features:

  • Display of debug logs
  • Support for directly printing into the console
  • Custom commands that can use any amount of parameters
  • Calling of normal methods on components
  • Proper parsing of command including support for escaped characters. For gameobjects with spaces in them, the space needs to escaped with a ‘\’.
  • Display of gameobject, components and methods to easily navigate through the scene
  • Help system using an attribute to add a help message to the custom commands
  • Custom parsers to be able to parse your own defined types. Built-in parsers for int, float and string. Also includes an example parser for Vector3
  • Easy to change the gui or use a different GUI system altogether. Includes a unity gui and a ngui front-end.
  • Includes various built-in commands and also includes an example field watch command script to show field values on the screen at runtime.

Known Issues/Limitations:

  • Overloaded methods can not be called, because the command parser is unable to determine which one should be called.

This console will be available soon on the unity asset store.

Leave a Reply

Your email address will not be published. Required fields are marked *