Skip to content

Game pauses or minimizes when unfocused - fix #190

@TheByterr

Description

@TheByterr

Problem

When running the game in windowed or borderless mode, the game pauses or sometimes minimizes when focus is lost (e.g. clicking outside or alt-tabbing).

This makes multitasking difficult and differs from behavior in newer Unity-based games.


Cause

This appears to be Unity's default behavior where:

Application.runInBackground = false

When the window loses focus, Unity pauses or throttles the game.


Fix

Setting:

Application.runInBackground = true;

prevents the pause entirely and allows the game to continue running when unfocused.


Testing

I verified this by patching Assembly-CSharp.dll (DotMod version) via dnSpy:

public void Start()
{
    Application.runInBackground = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions