Skip to main content

Lifecycle overview

Mount .xrlive pak

Load visual's Map

Spawn UIpanelComponent (reads JSON config, creates operator UI)

Create xRLive_Viewport widget (operator window preview)

  [ Visual running ]

Operator switches visual

EndPlay → automatic cleanup

Unmount pak

What is cleaned up automatically

When a visual closes, the SDK cleans up everything registered during the visual’s lifetime:
ThingCleanup method
xRLive_Viewport widget and all its childrenRemoveFromParent() — automatic
Operator panel widgetRemoveFromParent() — automatic
Actors placed in the visual’s MapLevel unload — automatic
Actors spawned at runtime via Spawn Visual ActorDestroy() — automatic
Niagara effects registered via Register Visual EffectDeactivate() + DestroyComponent() — automatic
MPC values registered via Register MPC for ResetReset to asset defaults — automatic

What you must manage yourself

Anything spawned or modified at runtime that is not registered with the SDK will persist into the next visual.
If you use the standard Spawn Actor from Class node instead of Spawn Visual Actor, the spawned actor will not be cleaned up automatically. You have two options:
  1. Replace it with Spawn Visual Actor — same inputs, auto-cleanup.
  2. Register it manually by calling Register Visual Actor right after spawning.
The same applies to Niagara effects and MPC changes — always register them at the start of your visual’s lifecycle (e.g., in Event BeginPlay).

Best practices

  • Use Spawn Visual Actor for any actor you create at runtime.
  • Call Register Visual Effect on any looping Niagara system right after spawning it.
  • Call Register MPC for Reset once on Event BeginPlay for every MPC your visual writes to.
  • Do not use Add to Viewport for custom widgets — add them as children inside xRLive_Viewport’s named slots so they are removed automatically.