π¦ Prop
A Prop represents a Dynamic Mesh which can be spawned in the world, can be grabbed around by characters and have physics.
info
note
If the Prop was spawned by the Client. It will have all interactions disabled (grabbable).
Usageβ
local my_prop = Prop(
Vector(-900, 185, 215),
Rotator(0, 90, 90),
"nanos-world::SM_Crate_07"
)
Note
Props smaller than radius 40 units or very thin (any side smaller than 20 units) will have CCD (Continuous Collision Detection) enabled to avoid falling through the floor or other objects. This will slightly increase the performance cost of them!
Note
Props bigger than radius 200 units will have Grabbable
off by default. This can be overridden with :SetGrabbable()
.
Note
Setting CollisionType.Auto
on Props will make them automatically switch between Normal
and IgnoreOnlyPawn
if they are smaller than radius 40 units.
Constructor Parametersβ
Type | Name | Default Value | Description |
---|---|---|---|
Vector | location | Vector(0, 0, 0) | Location to spawn |
Rotator | rotation | Rotator(0, 0, 0) | Rotation to spawn |
StaticMesh Asset | asset | | Static Mesh Asset to use |
CollisionType | collision_type | CollisionType.Auto | Collision |
boolean | gravity_enabled | true | |
boolean | is_grabbable | true | |
boolean | force_no_ccd | false | Force CCD to not be used on small Props (may cause Props passing through objects if it's kinda small) |
Functionsβ
Inherited Actor Functions
Returns | Name | Description | |
---|---|---|---|
AddImpulse | Applies a Force in world space to this Actor | ||
AttachTo | Attaches this Actor to another Actor | ||
Destroy | Destroys this Actor | ||
Detach | Detaches this Actor if attached | ||
SetCollision | Sets this Actor's collision type | ||
SetForce | Adds a permanent force to this Actor | ||
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
![]() | SetVisibility | Sets the Actor visibility | |
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed | ||
SetLocation | Sets this Actor's location in the game world | ||
SetNetworkAuthority | Sets the Player this Actor will have its physics calculated on Network Authority | ||
SetRelativeLocation | Sets this Actor's relative location in local space | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetScale | Sets this Actor's scale | ||
![]() | SetValue | Sets a value in this Actor, which can be accessed by any package | |
TranslateTo | Smoothly moves this Actor to the specified location | ||
RotateTo | Smoothly rotates this Actor to the specified angle | ||
boolean | HasNetworkAuthority | Gets if the LocalPlayer is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
![]() | boolean | IsBeingDestroyed | Gets if this Actor is being destroyed |
![]() | boolean | IsGravityEnabled | Gets whether gravity is enabled on this Actor |
![]() | boolean | IsVisible | Gets whether this actor is Visible or not |
![]() | boolean | IsInWater | Gets if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Gets if this Actor is currently Network Distributed |
![]() | boolean | IsValid | Returns if this Actor is valid (i.e. not destroyed) |
![]() | table | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | any | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | number | GetCollision | Gets this Actor's collision type |
![]() | number | GetID | Gets the universal network ID of this Actor |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Vector | GetForce | Gets this Actor's scale |
![]() | Vector | GetScale | Gets this Actor's scale |
![]() | string | GetType | Gets the type of this Actor |
![]() | any | GetValue | Gets a value stored on this Actor at the given key |
![]() | Vector | GetVelocity | Returns this Actor's current velocity |
string | AddActorTag | Adds an Unreal Actor Tag to this Actor | |
string | RemoveActorTag` | Remove an Unreal Actor Tag from this Actor | |
table | GetActorTags | Gets all Unreal Actor Tags from this Actor | |
![]() | function | Subscribe | Subscribes to an Event |
![]() | Unsubscribe | Unsubscribes from an Event |
Inherited Paintable Functions
Returns | Name | Description | |
---|---|---|---|
![]() | SetMaterial | Sets the material at the specified index of this Actor | |
SetMaterialFromWebUI | Sets the material at the specified index of this Actor to a WebUI object | ||
SetMaterialFromSceneCapture | Sets the material at the specified index of this Actor to a SceneCapture object | ||
ResetMaterial | Resets the material from the specified index to the original one | ||
![]() | SetMaterialColorParameter | Sets a Color parameter in this Actorβs material | |
![]() | SetMaterialScalarParameter | Sets a scalar parameter in this Actorβs material | |
![]() | SetMaterialTextureParameter | Sets a texture parameter in this Actor's material to an image on disk | |
![]() | SetMaterialVectorParameter | Sets a Vector parameter in this Actorβs material | |
![]() | SetPhysicalMaterial | Overrides this Actor's Physical Material with a new one |
Returns | Name | Description | |
---|---|---|---|
SetGrabbable | Sets ability to Characters to Grab this Prop | ||
SetPhysicsDamping | Sets the Physics damping of this Prop | ||
![]() | string | GetAssetName | Gets the Asset name |
![]() | Character | GetHandler | Gets the Character (if existing) which is holding this |
![]() | boolean | IsGrabbable | Gets ability to Grab this Prop |

SetGrabbable
β
Sets ability to Characters to Grab this Prop
my_prop:SetGrabbable(is_grabbable)
Type | Parameter | Description |
---|---|---|
boolean | is_grabbable | If the Prop will be able to be grabbable or not |

SetPhysicsDamping
β
Sets the Physics damping of this Prop
my_prop:SetPhysicsDamping(linear_damping, angular_damping)
Type | Parameter | Description |
---|---|---|
number | linear_damping | |
number | angular_damping |

GetAssetName
β
Gets the Asset name
Returns string
local asset_name = my_prop:GetAssetName()
-- e.g. returns "nanos-world::SM_Cube"

GetHandler
β
Gets the Character (if existing) which is holding this
Returns Character
local handler = my_prop:GetHandler()

IsGrabbable
β
Gets ability to Grab this Prop
Returns boolean
my_prop:IsGrabbable()
Eventsβ
Inherited Actor Events
Name | Description | |
---|---|---|
Destroy | Triggered when an Actor is destroyed | |
Spawn | Triggered when an Actor is spawned/created | |
ValueChange | Triggered when an Actor has a value changed with :SetValue() |
Name | Description | |
---|---|---|
Grab | Triggered when Character grabs a Prop | |
Hit | Triggered when this Prop hits something | |
Interact | Triggered when a Character tries to Grab up this | |
TakeDamage | Triggered when a Prop takes Damage | |
UnGrab | Triggered when Character ungrabs a Prop |
Grab
β
Triggered when Character grabs a Prop
Prop.Subscribe("Grab", function(self, character)
end)
Type | Parameter | Description |
---|---|---|
Prop | self | The prop which was Grabbed |
Character | character | The new Grabber |
Hit
β
Triggered when this Prop hits something
Prop.Subscribe("Hit", function(self, impact_force, normal_impulse, impact_location, velocity)
end)
Type | Parameter | Description |
---|---|---|
Prop | self | The prop which has been hit |
number | impact_force | The intensity of the Hit normalized by the Prop's weight |
Vector | normal_impulse | The impulse direction it hits |
Vector | impact_location | The world 3D location of the impact |
Vector | velocity | The Prop velocity at the moment it hits |

Interact
β
When a Character interacts with this Prop (i.e. try to Grab it)
Return false to prevent it
Type | Parameter | Description |
---|---|---|
Prop | self | |
Character | character |
TakeDamage
β
When Prop takes Damage
Type | Parameter | Description |
---|---|---|
Prop | self | |
number | damage | |
string | bone | Damaged bone |
DamageType | type | Damage Type |
Vector | from_direction | Direction of the damage relative to the damaged actor |
Player | instigator | The player which caused the damage |
any | causer | The object which caused the damage |
Prop.Subscribe("TakeDamage", function(self, damage, bone, type, from_direction, instigator, causer)
end)
UnGrab
β
Triggered when this Prop hits something
Prop.Subscribe("UnGrab", function(self, character)
end)
Type | Parameter | Description |
---|---|---|
Prop | self | The prop which has been ungrabbed |
Character | character | The old Grabber |