Auto-spawnables let an extension automatically create Actors or display UI Widgets when a specific SkyReal context becomes active. They use auto-registerable Data Assets and are managed by the Skr Auto Spawner Subsystem.
How It Works
-
Create an auto-spawnable Data Asset in the extension's
Content/RegistrableAssetsfolder. -
Select the Blueprint class to spawn and configure its spawning context.
-
When the context becomes active, SkyReal creates the Actor or adds the Widget to the viewport.
-
When the context is removed, SkyReal destroys the Actor or removes the Widget.
If an extension is loaded while its context is already active, its registered auto-spawnables are created immediately. Unloading the extension removes them.
Auto-Spawnable Actor
Use an auto-spawnable Actor for behavior that must exist only during a specific application state, such as Desktop or VR mode.
Create an Auto-Spawnable Actor
-
Create the Actor Blueprint that you want to spawn. Save it outside the
RegistrableAssetsfolder. -
In
Content/RegistrableAssets, create a new Data Asset. -
Select
SkrAutoSpawnableActorDescriptionas the Data Asset class. -
Set Actor Class To Spawn to your Actor Blueprint.
-
Set the required Spawning Context.
-
Ensure that Should Auto Register Asset is enabled, then save the Data Asset.
Actor Properties
|
Property |
Description |
|---|---|
|
|
The Actor Blueprint class created when the context becomes active. |
|
|
The application state in which the Actor must exist. |
Actor Spawning Contexts
|
Context |
Behavior |
|---|---|
|
|
Spawns the Actor when the world starts. This also works outside SkyReal VR, including during loading screens. |
|
|
Spawns the Actor when VR is activated and destroys it when VR is disabled. |
|
|
Spawns the Actor in Desktop mode and destroys it when VR is activated. |
Important: When an Actor context is removed, the system destroys every Actor of the configured class in the world. Do not manually create other Actors of the same class if they must survive the context change.
Auto-Spawnable Widget
Use an auto-spawnable Widget to add interface elements to the viewport for all modes, Desktop mode, VR mode, or another explicitly activated UI context.
Create an Auto-Spawnable Widget
-
Create a Widget Blueprint that inherits from
UserWidget. Save it outside theRegistrableAssetsfolder. -
In
Content/RegistrableAssets, create a new Data Asset. -
Select
SkrAutoSpawnableUserWidgetDescriptionas the Data Asset class. -
Set Widget Class to your Widget Blueprint.
-
Configure its spawning context, priority, Z-order, and persistence.
-
Ensure that Should Auto Register Asset is enabled, then save the Data Asset.
Widget Properties
|
Property |
Description |
|---|---|
|
|
The Widget Blueprint added to the viewport. |
|
|
The application state in which the Widget is displayed. |
|
|
Controls creation order within the same context. Lower values are processed first. |
|
|
Controls the Widget's visual layer: Background (250), Main (500), Popup (750), Overlay (1000), Modal (1250), or Custom. |
|
|
The exact Z-order used when the category is set to Custom. |
|
|
Reuses the same Widget instance when the context is activated again, preserving its state. Otherwise, a new instance is created. |
Widget Spawning Contexts
|
Context |
Behavior |
|---|---|
|
|
Adds the Widget to the viewport when the world starts, regardless of Desktop or VR mode. |
|
|
Displays the Widget only while SkyReal is in Desktop mode. |
|
|
Displays the Widget only while SkyReal is in VR mode. |
|
|
Available for systems that explicitly activate the Navigation Bar context. |
Important: When a Widget context is removed, the system removes every Widget of the configured class from its parent. Use a dedicated Widget class if another instance must remain visible.
Common Issues
-
Nothing is spawned: check that the Data Asset is inside
Content/RegistrableAssets, registration is enabled, and the selected context is active. -
The wrong mode is used: context names are case-sensitive. Use the values shown above.
-
The referenced class is missing: keep the Actor or Widget Blueprint inside the extension or one of its declared dependencies.
-
A Widget appears behind another interface: select the appropriate Z-order category or use a custom Z-order.