Skip to main content
Version: latest - a1.172.0 โš–๏ธ

๐Ÿ”ฃ Blueprint

A Blueprint Class allows spawning any Unreal Blueprint Actor in nanos world

Client & Server๐Ÿ”Auto-Distributed๐Ÿง‘โ€๐Ÿ’ปAPI Source
๐Ÿ‘ชInheritance
This class shares methods and events from Base Entity, Base Actor, Base Paintable.

tip

If your Actor Blueprint was spawned on the Server, it will be automatically synchronized with other players using the nanos world Network Authority system! It follows the same rules as all other entities!

๐ŸŽ’ Examplesโ€‹

Calling Blueprint Events from luaโ€‹

Client/Index.lua
-- Spawns the Blueprint
local blueprint = Blueprint(Vector(), Rotator(), "my-asset-pack::BP_MyBlueprint")

local param1 = 123
local param2 = "hello there!"

-- Calls the event, passing any parameters
blueprint:CallBlueprintEvent("MyBlueprintCustomEvent", param1, param2)

Binding Blueprint Event Dispatchersโ€‹

Client/Index.lua
-- Spawns the Blueprint
local blueprint = Blueprint(Vector(), Rotator(), "my-asset-pack::BP_MyBlueprint")

-- Subscribes to a Blueprint Event Dispatcher
blueprint:BindBlueprintEventDispatcher("MyBlueprintDispatcher", function(self, arg1, arg2)
Console.Log("Called from Blueprint!", arg1, arg2)
end)

๐Ÿ›  Constructorsโ€‹

Default Constructorโ€‹

No description provided

local my_blueprint = Blueprint(location, rotation, blueprint_asset, collision_type?)
Parameters
NameTypeDescription
locationVectorWorld location to spawn at
rotationRotatorWorld rotation to spawn with
blueprint_assetBlueprint ReferenceThe Blueprint asset to spawn
collision_type?CollisionTypeCollision profile of this Actor Default CollisionType.Auto

๐Ÿ—ฟ Static Functionsโ€‹

This class doesn't have own static functions.

Inherited static functions

๐Ÿฆ  Functionsโ€‹

BindBlueprintEventDispatcher: functionAssigns and Binds a Blueprint Event Dispatcher
CallBlueprintEvent: varargs of anyCalls a Blueprint Event or Function
GetBlueprintPropertyValue: anyGets a Blueprint Property/Variable value
SetBlueprintPropertyValueSets a Blueprint Property/Variable value directly
UnbindBlueprintEventDispatcherUnbinds a Blueprint Event Dispatcher

Inherited functions

BindBlueprintEventDispatcherSlowโ€‹

Assigns and Binds a Blueprint Event Dispatcher

local ret = my_blueprint:BindBlueprintEventDispatcher(dispatcher_name, callback)
Parameters
NameTypeDescription
dispatcher_namestringEvent Dispatcher name
callbackfunctionCallback function to call with this format
Returns
TypeDescription
functionthe callback itself

CallBlueprintEventSlowโ€‹

Calls a Blueprint Event or Function

Returns all Function return values on Client Side

local ret_01, ret_02, ... = my_blueprint:CallBlueprintEvent(event_name, arguments...?)
Parameters
NameTypeDescription
event_namestringEvent or Function name
arguments...?anySequence of arguments to pass to the event Default nil
Returns
TypeDescription
varargs of anythe function return values

GetBlueprintPropertyValueSlowโ€‹

Gets a Blueprint Property/Variable value

local value = my_blueprint:GetBlueprintPropertyValue(property_name)
Parameters
NameTypeDescription
property_namestringName of the Blueprint variable
Returns
TypeDescription
anythe value

See also SetBlueprintPropertyValue.

SetBlueprintPropertyValueSlowโ€‹

Sets a Blueprint Property/Variable value directly

my_blueprint:SetBlueprintPropertyValue(property_name, value)
Parameters
NameTypeDescription
property_namestringName of the Blueprint variable
valueanyThe value to set

See also GetBlueprintPropertyValue.

UnbindBlueprintEventDispatcherModerateโ€‹

Unbinds a Blueprint Event Dispatcher

my_blueprint:UnbindBlueprintEventDispatcher(dispatcher_name, callback?)
Parameters
NameTypeDescription
dispatcher_namestringEvent Dispatcher name
callback?functionOptional callback to unbind Default nil

๐Ÿš€ Eventsโ€‹

This class doesn't have own events.

โœ… List of Supported Parameter Typesโ€‹

List of all supported parameters which can be passed between Lua โ†” Blueprint:

Lua TypeBlueprint TypeLua โ†’ BPBP โ†’ Lua
booleanBooleanโœ…โœ…
numberByteโœ…โœ…
numberIntegerโœ…โœ…
numberInteger64โœ…โœ…
numberFloatโœ…โœ…
numberEnumโœ…โœ…
stringStringโœ…โœ…
stringNameโœ…โœ…
stringTextโœ…โœ…
Vector2DVector2Dโœ…โœ…
VectorVectorโœ…โœ…
RotatorRotatorโœ…โœ…
ColorColorโœ…โœ…
ColorLinearColorโœ…โœ…
StaticMeshStaticMeshActorโœ…โœ…
PropStaticMeshActorโœ…โœ…
WeaponSkeletalMeshActorโœ…โœ…
Base VehicleWheeledVehiclePawnโœ…โœ…
GrenadeStaticMeshActorโœ…โœ…
MeleeStaticMeshActorโœ…โœ…
LightPointLight, SpotLight or RectLightโœ…โœ…
DecalDecalActorโœ…โœ…
TextRenderTextRenderActorโœ…โœ…
Text3DText3DActorโœ…โœ…
SoundAmbientSoundโœ…โœ…
CanvasMaterialInstanceDynamicโœ…โŒ
WebUIMaterialInstanceDynamicโœ…โŒ
SceneCaptureMaterialInstanceDynamicโœ…โŒ
BlueprintActorโœ…โœ…
WidgetWidgetโœ…โŒ
Base ActorActorโœ…โœ…
PlayerPlayerControllerโœ…โŒ
Image PathTexture2Dโœ…โŒ
stringClassโœ…โŒ
steam-avatar://MaterialInstanceDynamicโœ…โŒ
tableCurveFloatโœ…โŒ
tableTransformโœ…โœ…
tableSlateBrushโœ…โœ…
tableSlateFontInfoโœ…โœ…
tableAny Structโœ…โœ…
Note

It is only possible to pass Actors from Blueprint โ†’ Lua if the Actor is a Spawned Entity. It is not possible to pass newly spawned Actors in Blueprints to Lua.

tip

Passing Maps, Arrays and Sets is also supported! As long their keys/values are in the list above.

Any Structโ€‹

Custom Structs can also be passed and retrieved, just pass an object with the same properties as the Unreal Struct, examples:

FTransformโ€‹

{
["Translation"] = Vector(),
["Rotation"] = Rotator(),
["Scale"] = Vector()
}

FSlateBrushโ€‹

{
["DrawAs"] = 0, -- ESlateBrushDrawType
["Tiling"] = 0, -- ESlateBrushTileType
["Mirroring"] = 0, -- ESlateBrushMirrorType
["ImageSize"] = Vector2D(),
["Tint"] = Color(),
["Image"] = "package://sandbox/Client/my_image.jpg", -- Special Path, or Canvas, WebUI, SceneCapture
["Margin"] = {}, -- FMargin
["OutlineSettings"] = {} -- FSlateBrushOutlineSettings
}

FSlateFontInfoโ€‹

{
["FontFamily"] = "package://my-package/Client/my_font.ttf", -- Special Path
["FontMaterial"] = "my-asset-pack::M_MyMaterial", -- Material Path
["OutlineSettings"] = {}, -- FSlateBrushOutlineSettings
["Typeface"] = "", -- string
["Size"] = 24,
["LetterSpacing"] = 0,
["SkewAmount"] = 0.0,
["Monospacing"] = false,
["MonospacedWidth"] = 1.0
}

FMarginโ€‹

{
["Bottom"] = 0.0,
["Left"] = 0.0,
["Right"] = 0.0,
["Top"] = 0.0
}

FVector4โ€‹

{
["W"] = 0.0,
["X"] = 0.0,
["Y"] = 0.0,
["Z"] = 0.0
}

UCurveFloatโ€‹

{
[0.0] = 0.0,
[0.25] = 0.8,
[0.5] = 1.0,
[0.75] = 0.3,
[1.0] = 0.0,
}