actors.spawn

Spawns a Blueprint actor in the current world.

Syntax

ue.actors.spawn(blueprint_path: string, options?: table) -> ActorDescriptor?, string?

Parameters

ParameterTypeDescription
blueprint_pathstringFull generated Blueprint class path.
options.locationtable?Optional { X, Y, Z } location.
options.rotationtable?Optional { Pitch, Yaw, Roll } rotation.

Returns

TypeDescription
ActorDescriptorDescriptor for the spawned actor.
nil, stringNo world, asset load failure, or spawn failure.

Example

local crate = assert(ue.actors.spawn(
    "/Game/Blueprints/BP_Crate.BP_Crate_C",
    {
        location = { X = 0, Y = 0, Z = 100 },
        rotation = { Pitch = 0, Yaw = 0, Roll = 0 }
    }
))

On this page