Components
An Actor by itself is an empty shell โ it exists in the world but doesn't do anything. Components are the LEGO pieces you snap onto an Actor to give it shape, behavior, and personality.
Want your Actor to have a 3D model? Attach a StaticMeshComponent. Need it to play sounds? Add an AudioComponent. Want it to collide with things? Slap on a CollisionComponent.
Common Component Typesโ
| Component | What it does |
|---|---|
| StaticMeshComponent | Gives the Actor a visible 3D model |
| SkeletalMeshComponent | A 3D model with a skeleton for animation |
| BoxCollisionComponent | Simple box-shaped collision detection |
| SphereCollisionComponent | Spherical collision detection |
| AudioComponent | Plays sounds in 3D space |
| PointLightComponent | Emits light from a single point |
| CameraComponent | Adds a camera viewpoint |
| CharacterMovementComponent | Handles walking, jumping, falling, swimming |
Adding Componentsโ
In HELIX Studio, you can add components visually in the Blueprint editor's Components panel โ hit Add and pick what you need. You can also add them at runtime through code:
- Blueprint
- Lua
- JavaScript
-- Add a static mesh component to an actor
function MyActor:Initialize(Initializer)
local mesh_comp = Initializer:CreateDefaultSubobject(
"MyMesh", UE.UStaticMeshComponent
)
self.RootComponent = mesh_comp
end
// Add a static mesh component to an actor
class MyActor extends ue.Actor {
Constructor() {
let meshComp = this.CreateDefaultSubobject(
"MyMesh", ue.StaticMeshComponent
);
this.RootComponent = meshComp;
}
}
The Component Hierarchyโ
Components form a tree. Every Actor has a Root Component at the top, and other components attach underneath it. When the root moves, everything attached moves with it โ like a puppet on strings.
MyCharacter (Actor)
โโโ CapsuleComponent (Root)
โ โโโ SkeletalMeshComponent
โ โ โโโ AudioComponent
โ โโโ CameraComponent
โโโ CharacterMovementComponent
Building Blocks, Not Monolithsโ
The beauty of components is reusability. Instead of creating a totally new Actor class for every object, you mix and match components. A treasure chest and a mailbox might share the same InteractableComponent โ different look, same open/close behavior. Build small, compose big.
If you find yourself copying logic between Actor classes, that logic probably belongs in a shared component instead.