AActor::Layers
#include "GameFramework/Actor.h"
Access: public
Specifiers: UPROPERTYEditAnywhereAdvancedDisplay
Description
The editor layer names this actor belongs to. Stored outside editor-only data so that level designers can toggle layer visibility at runtime for profiling purposes.
Caveats & Gotchas
- • These are the old UE4-era Layer system, not the World Partition Data Layer system (UDataLayerAsset). They serve a completely different purpose and are managed separately in the Layers panel.
- • Although the property is stored in runtime data to enable runtime layer-visibility toggling, the Layers panel UI is editor-only. Modifying this array at runtime has no visible effect unless your own code explicitly reads it.
Signature
UPROPERTY(EditAnywhere, AdvancedDisplay, Category = Actor)
TArray< FName > Layers; Example
Check if actor belongs to a layer at runtime C++
FName ProfilingLayer = FName("ProfilingActors");
if (MyActor->Layers.Contains(ProfilingLayer))
{
MyActor->SetActorHiddenInGame(true);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?