๐ฆ 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?, spawn_mode?)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector | World location to spawn at |
rotation | Rotator | World rotation to spawn with |
asset | StaticMesh Reference | The asset to use |
collision_type? | CollisionType | Setting CollisionType.Auto will make it automatically switch between Normal and IgnoreOnlyPawn if they are smaller than radius 40 units Default CollisionType.Auto |
gravity_enabled? | boolean | Whether gravity affects this Actor Default true |
grab_mode? | GrabMode | Whether or not the Prop can be grabbed Default GrabMode.Auto |
ccd_mode? | CCDMode | 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 Default CCDMode.Auto |
spawn_mode? | SpawnMode | Pass SpawnMode.AfterConstructor or SpawnMode.Manual to avoid immediately sending the entity to clients and improve performance when you want to configure it by setting several configs. Must call FinishSpawn() after all Default SpawnMode.Immediate |
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โ
This class doesn't have own static functions.
Inherited static functions
Subscribe, UnsubscribeSubscribeRemoteGetAll, GetByIndex, GetCount, GetPairs๐ฆ Functionsโ
| Appearance | ||
GetMesh: StaticMesh Reference | Gets the Asset name | |
SetInteractionToolTipText | Sets the interaction tooltip text shown when a Character interacts with this Prop | |
SetMesh | Changes the mesh in runtime | |
| Handling | ||
GetGrabMode: GrabMode | Gets ability to Grab this Prop | |
GetHandler: Character or nil | Gets the Character (if existing) which is holding this | |
SetGrabMode | Sets ability to Characters to Grab this Prop | |
| Physics | ||
GetMassOverride: float | Gets the overridden mass | |
GetMassScale: float | Gets the mass scale | |
IsOneWayInteraction: boolean | Gets whether one-way interaction is enabled on this Prop | |
SetBuoyancyPontoons | Sets the Buoyancy Pontoons used by the Water simulation | |
SetBuoyancySettings | Sets how this entity behaves on Water | |
SetMassOverride | Override the mass (in Kg) of this Prop | |
SetMassScale | Change the mass scale used to calculate the mass of this Prop | |
SetOneWayInteraction | Sets whether this Prop treats every physics body without it as infinitely heavy, so they push it around but never get pushed back | |
SetPhysicsDamping | Sets the Physics damping of this Prop | |
Inherited functions
GetMaterialColorParameter, GetMaterialScalarParameter, GetMaterialTextureParameter, GetMaterialVectorParameter, ResetMaterial, SetMaterial, SetMaterialColorParameter, SetMaterialFromCanvas, SetMaterialFromSceneCapture, SetMaterialFromWebUI, SetMaterialScalarParameter, SetMaterialTextureParameter, SetMaterialVectorParameter, SetPhysicalMaterialGetDistanceFromCamera, GetScreenPercentage, IsVisible, SetCastShadow, SetHighlightEnabled, SetOutlineEnabled, SetRenderCullDistance, SetVisibility, WasRecentlyRenderedAttachTo, Detach, GetAttachedEntities, GetAttachedTo, GetAttachedToSocket, GetSocketTransformGetLifeSpan, SetLifeSpanGetDimension, GetNetworkAuthority, HasNetworkAuthority, IsNetworkDistributed, SetDimension, SetDistanceOptimizationMultiplier, SetNetworkAuthority, SetNetworkAuthorityAutoDistributedGetAllValuesKeys, GetValue, SetValueSubscribe, UnsubscribeDestroy, FinishSpawn, IsBeingDestroyed, IsSpawned, IsValid, SetSpawnModeBroadcastRemoteEvent, BroadcastRemoteInRadiusEvent, CallRemoteEvent, CallRemoteEvent, CallRemotePlayersEvent, HasAuthority, SubscribeRemoteGetIDAppearancefunctionsโ

GetMeshOptimalโ
Gets the Asset name
local asset = my_prop:GetMesh()
Returns
| Type | Description |
|---|---|
| StaticMesh Reference | asset name |
See also SetMesh.

SetInteractionToolTipTextOptimalโ
Sets the interaction tooltip text shown when a Character interacts with this Prop
my_prop:SetInteractionToolTipText(tool_tip_text)
Parameters
| Name | Type | Description |
|---|---|---|
tool_tip_text | string | Text to show in the interaction tooltip |

SetMeshSlowโ
Changes the mesh in runtime
my_prop:SetMesh(asset)
Parameters
| Name | Type | Description |
|---|---|---|
asset | StaticMesh Reference | asset |
See also GetMesh.
Handlingfunctionsโ

GetGrabModeOptimalโ
Gets ability to Grab this Prop
local grab_mode = my_prop:GetGrabMode()
Returns
| Type | Description |
|---|---|
| GrabMode | Ability to Grab this Prop |
See also SetGrabMode.

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

SetGrabModeOptimalโ
Sets ability to Characters to Grab this Prop
my_prop:SetGrabMode(grab_mode)
Parameters
| Name | Type | Description |
|---|---|---|
grab_mode | GrabMode | 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.
Physicsfunctionsโ

GetMassOverrideOptimalโ
Gets the overridden mass
local ret = my_prop:GetMassOverride()
Returns
| Type | Description |
|---|---|
| float | The overridden mass |
See also SetMassOverride.

GetMassScaleModerateโ
Gets the mass scale
local ret = my_prop:GetMassScale()
Returns
| Type | Description |
|---|---|
| float | The mass scale |
See also SetMassScale.

IsOneWayInteractionOptimalโ
Gets whether one-way interaction is enabled on this Prop
local ret = my_prop:IsOneWayInteraction()
Returns
| Type | Description |
|---|---|
| boolean | No description provided |
See also SetOneWayInteraction.

SetBuoyancyPontoonsModerateโ
Sets the Buoyancy Pontoons used by the Water simulation
Sets the spherical Pontoons used to float this entity on Water, overriding the ones automatically calculated from the Mesh bounds and mass.
Pass no value (or an empty table) to go back to the automatically calculated ones.
Pontoons only have an effect on Maps with Water Buoyancy enabled
my_prop:SetBuoyancyPontoons(pontoons?)

SetBuoyancySettingsModerateโ
Sets how this entity behaves on Water
Any value passed as nil restores that setting's default.
The automatically calculated Pontoons are sized for the default buoyancy_coefficient, so a higher one makes the entity float higher
my_prop:SetBuoyancySettings(enabled?, buoyancy_coefficient?, buoyancy_damp?, max_buoyant_force?)
Parameters
| Name | Type | Description |
|---|---|---|
enabled? | boolean | Whether Buoyancy forces are applied at all Default true |
buoyancy_coefficient? | float | How much it floats, the higher the more Default 0.1 |
buoyancy_damp? | float | First order damping on the vertical velocity, reduces bobbing. When nil (or negative) it is calculated from the mass and Pontoons Default nil |
max_buoyant_force? | float | Clamp on the upwards force, stops light objects being launched out of the water Default 1000000000 |

SetMassOverrideOptimalโ
Override the mass (in Kg) of this Prop
my_prop:SetMassOverride(mass)
Parameters
| Name | Type | Description |
|---|---|---|
mass | float | Mass in KG to override. Pass -1 to reset to default |
See also GetMassOverride.

SetMassScaleModerateโ
Change the mass scale used to calculate the mass of this Prop
my_prop:SetMassScale(scale)
Parameters
| Name | Type | Description |
|---|---|---|
scale | float | The new mass scale used to calculate the mass of this Prop |
See also GetMassScale.

SetOneWayInteractionOptimalโ
Sets whether this Prop treats every physics body without it as infinitely heavy, so they push it around but never get pushed back
my_prop:SetOneWayInteraction(one_way_interaction)
Parameters
| Name | Type | Description |
|---|---|---|
one_way_interaction | boolean | No description provided |
See also IsOneWayInteraction.

SetPhysicsDampingOptimalโ
Sets the Physics damping of this Prop
my_prop:SetPhysicsDamping(linear_damping, angular_damping)
๐ Eventsโ
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 |
Inherited events
ClassRegister, Destroy, Spawn, ValueChange
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, other_actor)
-- Hit was called
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Prop | The prop which has been hit |
impact_force | float | The intensity of the Hit normalized by the Prop's weight |
normal_impulse | Vector | The impulse direction it hits |
impact_location | Vector | The world 3D location of the impact |
velocity | Vector | The Prop velocity at the moment it hits |
other_actor | Base Actor or nil | The other actor that hit this Prop |

Interactโ
When a Character interacts with this Prop (i.e. try to Grab it)
Prop.Subscribe("Interact", function(self, character)
-- Interact was called
return true
end)
Arguments
| Name | Type | Description |
|---|---|---|
self | Prop | the object that undergoes an interaction |
character | Character | the character who interacts with the object |
Returns
| Type | Description |
|---|---|
| boolean | Return false to prevent the interaction (i.e. prevent being grabbed) |

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


