UStaticMeshComponent
Inherits: UObjectBase › UObjectBaseUtility › UObject › UActorComponent › USceneComponent › UPrimitiveComponent › UMeshComponent › UStaticMeshComponent
#include "Components/StaticMeshComponent.h" Description
A component that renders a static mesh asset. The most common component for environment geometry, props, and any non-animated visual mesh.
Caveats & Gotchas
- • Static meshes have no skeleton — they cannot play animation. Use USkeletalMeshComponent for animated meshes.
- • Mobility matters: Static mobility meshes are fully baked into lighting; Stationary allows shadow-casting; Movable disables baked lighting and is more expensive.
- • SetStaticMesh() can be called at runtime to swap the mesh asset.
Example
Create and attach a static mesh in a constructor C++
UStaticMeshComponent* Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));
Mesh->SetupAttachment(RootComponent);
Mesh->SetStaticMesh(MyMeshAsset); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?