actors.spawn
Spawns a Blueprint actor in the current world.
Syntax
ue.actors.spawn(blueprint_path: string, options?: table) -> ActorDescriptor?, string?Parameters
| Parameter | Type | Description |
|---|---|---|
blueprint_path | string | Full generated Blueprint class path. |
options.location | table? | Optional { X, Y, Z } location. |
options.rotation | table? | Optional { Pitch, Yaw, Roll } rotation. |
Returns
| Type | Description |
|---|---|
ActorDescriptor | Descriptor for the spawned actor. |
nil, string | No 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 }
}
))