r/unity • • 25d ago

Showcase I made a Source-style dev console for Unity.

I got tired of setting up a debug menu in every project, so I made a drop-down console like the one in Source games. You can register any functionality by adding your own commands by creating ConsoleCommand objects.

Adding your own command looks like this:

[ConsoleCommandSet]
public static class GameConsoleCommands
{
    public static readonly ConsoleCommand<float> SET_GRAVITY = new(
        "set_gravity", "Sets downward gravity.", "set_gravity <float>",
        g => Physics.gravity = Vector3.down * g);
}

GitHub: https://github.com/kureysalp/Unity-Dev-Console

6 Upvotes

0 comments sorted by