HoloScript v3.4 introduced a high-performance Unreal Engine 5 (UE5) compiler target that converts .holo files directly into C++ Source. This guide covers how to integrate, extend, and optimize these generated actors in your UE5 projects.
The UE5 target compiles HoloScript compositions into AActor-derived C++ classes. Each HoloScript object is mapped to an appropriate UActorComponent.
| HoloScript Construct | UE5 Equivalent |
|---|---|
object |
AActor or USceneComponent |
geometry: "cube" |
UStaticMeshComponent (Cube mesh) |
light |
ULightComponent (Point, Spot, or Directional) |
@physics |
SetSimulatePhysics(true) on root component |
@networked |
AActor::SetReplicates(true) + UPROPERTY(Replicated) |
Run the HoloScript CLI to generate the C++ source files.
holoscript compile my-scene.holo --target unreal --output ./Source/MyProject/Generated/- Copy the generated
.hand.cppfiles to your project'sSourcedirectory. - In Unreal Editor, select Tools > Refresh Visual Studio Project.
- Compile the project in your IDE or via Unreal's Live Coding.
Once compiled, your HoloScript scene appears as a standard C++ Actor class. You can:
- Drag and drop it into the level.
- Spawn it via
SpawnActorFromClass. - Build Child Blueprints from it to add visual assets or Niagara effects.
For dynamic script execution (non-compiled mode), use the UHoloBridgeComponent.
// MyActor.h
UCLASS()
class MYPROJECT_API AMyInteractiveActor : public AActor {
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere)
UHoloBridgeComponent* HoloBridge;
virtual void BeginPlay() override;
};
// MyActor.cpp
void AMyInteractiveActor::BeginPlay() {
Super::BeginPlay();
HoloBridge->LoadScript("path/to/script.holo");
}The HoloScript compiler automatically flags generated meshes for Nanite if the vertex count exceeds 10,000. To force Nanite for specific objects:
object HighPolyModel {
geometry: "models/statue.fbx"
unreal_options: {
nanite: true
lumen_detail: 2.0
}
}
You can trigger Niagara systems from HoloScript events:
object Torch {
@onItemIgnited: {
self.trigger_particle("NS_Fire")
}
}
- Private Variables: Variables in HoloScript are mapped to
privateC++ members withpublicGetters/Setters. - Multithreading: Script-driven transforms are executed on the Game Thread during
Tick. Heavy logic should be moved to specialized C++Asynctasks if possible.
- Unreal USD Physics Bridge - use HoloScript as the SimulationContract-preserving IR, then import USD into Unreal for rendering and packaging
- Publishing & platform terms — Unreal Engine EULA and platform compliance
- Platform Overview