UActorFactory

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Classes/ActorFactories/ActorFactory.h

Include

#include "ActorFactories/ActorFactory.h"

Syntax

class UActorFactory : public UObject

Variables

Name Description

Public variable

uint32: 1

 

bShowInEditorQuickMenu

Whether to appear in the editor add actor quick menu

Public variable

uint32: 1

 

bUseSurfaceOrientation

Public variable

FText

 

DisplayName

Name used as basis for 'New Actor' menu.

Public variable

int32

 

MenuPriority

Indicates how far up the menu item should be. The higher the number, the higher up the list.

Public variable

TSubclassOf< cl...

 

NewActorClass

AActor subclass this ActorFactory creates.

Public variable

FString

 

NewActorClassName

Name of actor subclass this actorfactory creates - dynamically loaded. Overrides NewActorClass.

Public variable

FVector

 

SpawnPositionOffset

Translation applied to the spawn position.

Constructors

Name Description

Public function

UActorFactory

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual Const

FQuat

 

AlignObjectToSurfaceNormal

(
    const FVector& InSurfaceNormal,
    const FQuat& ActorRotation
)

Return a quaternion which aligns this actor type to the specified surface normal

Public function Virtual

bool

 

CanCreateActorFrom

(
    const FAssetData& AssetData,
    FText& OutErrorMsg
)

Public function

AActor *

 

CreateActor

(
    UObject* Asset,
    ULevel* InLevel,
    FTransform Transform,
    EObjectFlags InObjectFlags,
    const FName InName
)

Called to actual create an actor with the supplied transform (scale is ignored), using the properties in the ActorFactory

Public function

UBlueprint &...

 

CreateBlueprint

(
    UObject* Instance,
    UObject* Outer,
    const FName Name,
    const FName CallingContext
)

Called to create a blueprint class that can be used to spawn an actor from this factory

Public function Virtual

UObject *...

 

GetAssetFromActorInstance

(
    AActor* ActorInstance
)

Given an instance of an actor pertaining to this factory, find the asset that should be used to create a new actor

Public function Virtual

AActor *

 

GetDefaultActor

(
    const FAssetData& AssetData
)

Initialize NewActorClass if necessary, and return default actor for that class.

Public function

UClass *

 

GetDefaultActorClass

(
    const FAssetData& AssetData
)

Initialize NewActorClass if necessary, and return that class.

Public function Const

FText

 

GetDisplayName()

Name to put on context menu.

Protected function Virtual

void

 

PostCreateBlueprint

(
    UObject* Asset,
    AActor* CDO
)

Override this in derived factory classes if needed.

Protected function Virtual

void

 

PostSpawnActor

(
    UObject* Asset,
    AActor* NewActor
)

Subclasses may implement this to modify the actor after it has been spawned IMPORTANT: If you override this, you should usually also override PostCreateBlueprint()!

Protected function Virtual

bool

 

PreSpawnActor

(
    UObject* Asset,
    FTransform& InOutLocation
)

Protected function Virtual

AActor *

 

SpawnActor

(
    UObject* Asset,
    ULevel* InLevel,
    const FTransform& Transform,
    EObjectFlags ObjectFlags,
    const FName Name
)

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback