Skip to content

Fix MASMonitor screen camera wiping display when IVA is inactive#387

Open
kilfoil wants to merge 1 commit into
FirstPersonKSP:masterfrom
kilfoil:fix/monitor-camera-on-become-inactive
Open

Fix MASMonitor screen camera wiping display when IVA is inactive#387
kilfoil wants to merge 1 commit into
FirstPersonKSP:masterfrom
kilfoil:fix/monitor-camera-on-become-inactive

Conversation

@kilfoil

@kilfoil kilfoil commented Jul 4, 2026

Copy link
Copy Markdown

Problem

When the active vessel switches (e.g. a crew member goes on EVA, or you switch to another vessel), KSP calls OnBecomeInactive() on all InternalModule instances. MASMonitor does not override this method.

The monitor's screenCamera is left enabled with ClearFlags.SolidColor and an opaque-black backgroundColor. With targetTexture no longer pointing to a live render texture, Unity falls back to rendering the camera to the main display. This wipes the skybox and scaled-space bodies (Mun, Kerbin, stars, etc.) every frame until the vessel is reactivated.

Fix

Override OnBecomeInactive() to disable screenCamera, and OnBecomeActive() to re-enable it. The monitor has nothing to render when the IVA is inactive, so disabling the camera is correct behaviour.

public override void OnBecomeInactive()
{
    if (screenCamera != null)
    {
        screenCamera.enabled = false;
    }
}

public override void OnBecomeActive()
{
    if (screenCamera != null)
    {
        screenCamera.enabled = true;
    }
}

Reproduction

  1. Board a vessel that has a JSI BasicMFD prop using MASMonitor
  2. Have a crew member go on EVA, or switch to another vessel
  3. Observe: background goes black; skybox, Mun, Kerbin all invisible
  4. Switch back to the vessel: display returns to normal

…active

When the active vessel switches (e.g. crew goes on EVA), KSP calls
OnBecomeInactive() on all InternalModules. MASMonitor's screenCamera
is left enabled with ClearFlags.SolidColor and an opaque-black background,
so it renders to the main screen every frame, wiping the skybox and
scaled-space bodies (Mun, Kerbin, etc.) until the vessel is reactivated.

Fix: override OnBecomeInactive() to disable screenCamera, and
OnBecomeActive() to re-enable it.
@kilfoil kilfoil force-pushed the fix/monitor-camera-on-become-inactive branch from f918aba to 79fb279 Compare July 5, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant