π¦ Prop
A Prop represents a Dynamic Mesh which can be spawned in the world, can be grabbed around by characters and have physics.
π Examplesβ
local my_prop = Prop(
Vector(-900, 185, 215),
Rotator(0, 90, 90),
"nanos-world::SM_Crate_07"
)
π Constructorsβ
Default Constructor
No description provided
local my_prop = Prop(location, rotation, asset, collision_type?, gravity_enabled?, grab_mode?, ccd_mode?)
Type | Name | Default | Description |
---|---|---|---|
Vector | location | Required parameter | No description provided |
Rotator | rotation | Required parameter | No description provided |
StaticMesh Reference | asset | Required parameter | No description provided |
CollisionType | collision_type | CollisionType.Auto | Setting CollisionType.Auto will make it automatically switch between Normal and IgnoreOnlyPawn if they are smaller than radius 40 units. |
boolean | gravity_enabled | true | No description provided |
GrabMode | grab_mode | GrabMode.Auto | Whether or not the Prop can be grabbed |
CCDMode | ccd_mode | CCDMode.Auto | Whether or not the Prop should have CCD enabled (disabling it may cause Props passing through objects if it's kinda small). It's smart to force it disabled on 'visual only' props. |
If the Prop was spawned by the Client. It will have all interactions disabled (e.g. it will not be able to be grabbed by Characters).
Props smaller than radius 40 units or very thin (any side smaller than 20 units) will have CCD (Continuous Collision Detection) enabled automatically to avoid falling through the floor or other objects. This will slightly increase the performance cost of them!
πΏ Static Functionsβ
Inherited Entity Static Functions
This class doesn't have own static functions.
π¦ Functionsβ
Inherited Entity Functions
Inherited Actor Functions
Inherited Paintable Functions
Returns | Name | Description | |
---|---|---|---|
![]() | GrabMode | GetGrabMode | Gets ability to Grab this Prop |
![]() | Character or nil | GetHandler | Gets the Character (if existing) which is holding this |
![]() | StaticMesh Reference | GetMesh | Gets the Asset name |
SetGrabMode | Sets ability to Characters to Grab this Prop | ||
SetMesh | Changes the mesh in runtime | ||
SetPhysicsDamping | Sets the Physics damping of this Prop |

GetGrabMode
Gets ability to Grab this Prop
β Returns GrabMode.
local ret = my_prop:GetGrabMode()
See also SetGrabMode.

GetHandler
Gets the Character (if existing) which is holding this
β Returns Character or nil (the character that holds the object).
local ret = my_prop:GetHandler()

GetMesh
Gets the Asset name
β Returns StaticMesh Reference (asset name).
local ret = my_prop:GetMesh()
See also SetMesh.

SetGrabMode
Sets ability to Characters to Grab this Prop
my_prop:SetGrabMode(grab_mode)
Type | Parameter | Default | Description |
---|---|---|---|
GrabMode | grab_mode | Required parameter | If the Prop will be able to be grabbable or not. Set to Auto to automatically define based on Prop's size. |
See also GetGrabMode.

SetMesh
Changes the mesh in runtime
my_prop:SetMesh(asset)
Type | Parameter | Default | Description |
---|---|---|---|
StaticMesh Reference | asset | Required parameter | asset |
See also GetMesh.

SetPhysicsDamping
Sets the Physics damping of this Prop
my_prop:SetPhysicsDamping(linear_damping, angular_damping)
Type | Parameter | Default | Description |
---|---|---|---|
float | linear_damping | Required parameter | No description provided |
float | angular_damping | Required parameter | No description provided |
π Eventsβ
Inherited Entity Events
Inherited Actor Events
Name | Description | |
---|---|---|
![]() | Grab | Triggered when Character grabs a Prop |
![]() | Hit | Triggered when this Prop hits something |
Interact | When a Character interacts with this Prop (i.e. try to Grab it) | |
TakeDamage | When Prop takes Damage | |
![]() | UnGrab | Triggered when this Prop is ungrabbed |

Grab
Triggered when Character grabs a Prop
Prop.Subscribe("Grab", function(self, character)
-- Grab was called
end)

Hit
Triggered when this Prop hits something
Prop.Subscribe("Hit", function(self, impact_force, normal_impulse, impact_location, velocity)
-- Hit was called
end)
Type | Argument | Description |
---|---|---|
Prop | self | The prop which has been hit |
float | 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 the interaction (i.e. prevent being grabbed)
Prop.Subscribe("Interact", function(self, character)
-- Interact was called
end)
Type | Argument | Description |
---|---|---|
Prop | self | the object that undergoes an interaction |
Character | character | the character who interacts with the object |

TakeDamage
When Prop takes Damage
Prop.Subscribe("TakeDamage", function(self, damage, bone, type, from_direction, instigator, causer)
-- TakeDamage was called
end)
Type | Argument | Description |
---|---|---|
Prop | self | the object that takes the damage |
integer | damage | amount of damage |
string | bone | Damaged bone |
DamageType | type | Damage Type |
Vector | from_direction | Direction of the damage relative to the damaged actor |
Player or nil | instigator | The player which caused the damage |
Base Actor or nil | causer | The object which caused the damage |

UnGrab
Triggered when this Prop is ungrabbed
Prop.Subscribe("UnGrab", function(self, character)
-- UnGrab was called
end)