Base Pickable
Base class for all Pickables
Pickables are special Actors which can be grabbed, held and used by Characters. Examples of Pickable Actor are: Weapon, Melee and Grenade.
They have special methods and events and are highlighted when looked at by a Character.
Functionsβ
Returns | Name | Description | |
---|---|---|---|
![]() | AddSkeletalMeshAttached | Spawns and attaches a SkeletalMesh to this Pickable | |
![]() | AddStaticMeshAttached | Spawns and attaches a StaticMesh to this Pickable | |
PullUse | Triggers the PullUse event on this Pickable | ||
ReleaseUse | Triggers the ReleaseUse event on this Pickable | ||
![]() | RemoveSkeletalMeshAttached | Removes, if it exists, a SkeletalMesh from this Pickable given its custom ID | |
![]() | RemoveStaticMeshAttached | Removes, if it exists, a StaticMesh from this Pickable given its custom ID | |
SetAttachmentSettings | Sets the adjustment of the Attachment | ||
SetCrosshairMaterial | Sets the crosshair material for this Pickable | ||
SetPickable | Sets if this Pickable can be grabbed | ||
![]() | string | GetAssetName | Gets the name of the asset this Pickable uses |
![]() | Character | GetHandler | Gets the Character, if it exists, that's holding this Pickable |

AddSkeletalMeshAttached
β
Spawns and attaches a SkeletalMesh to this Pickable, the SkeletalMesh must have the same skeleton used by this Actor's mesh, and will follow all animations from it. Uses a custom ID to be used for removing it later
For customizing the Materials specific of a SkeletalMeshAttached, please use the following syntax as the
parameter_name
in the Paintable methods:attachable///[ATTACHABLE_ID]/[PARAMETER_NAME]
, where [ATTACHABLE_ID] is the ID of the Attachable, and [PARAMETER_NAME] is the name of the parameter you want to change.
entity:AddSkeletalMeshAttached(id, skeletal_mesh_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | id | Unique ID to assign to the SkeletalMesh | |
string | skeletal_mesh_path | SkeletalMesh asset to use |

AddStaticMeshAttached
β
Spawns and attaches a StaticMesh to this Pickable in a Socket with a relative location and rotation. Uses a custom ID to be used for removing it later
For customizing the Materials specific of a StaticMeshAttached, please use the following syntax as the
parameter_name
in the Paintable methods:attachable///[ATTACHABLE_ID]/[PARAMETER_NAME]
, where [ATTACHABLE_ID] is the ID of the Attachable, and [PARAMETER_NAME] is the name of the parameter you want to change.
entity:AddStaticMeshAttached(id, static_mesh_path, socket, relative_location, relative_rotation)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | id | Unique ID to assign to the StaticMesh | |
string | static_mesh_path | StaticMesh asset to use | |
string | socket | "" | Bone socket to attach to |
Vector | relative_location | Vector(0, 0, 0) | Relative location |
Rotator | relative_rotation | Rotator(0, 0, 0) | Relative rotation |

PullUse
β
Pulls the usage of this Pickable (will start firing if this is a weapon)
entity:PullUse(release_use_after)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | release_use_after | -1 | Time in seconds to automatically release the usage (-1 will not release, 0 will release one tick after) |

ReleaseUse
β
Releases the usage of this Pickable (will stop firing if this is a weapon)
entity:ReleaseUse()

RemoveSkeletalMeshAttached
β
Removes, if it exists, a SkeletalMesh from this Pickable given its custom ID
entity:RemoveSkeletalMeshAttached(id)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | id | Unique ID of the SkeletalMesh to remove |

RemoveStaticMeshAttached
β
Removes, if it exists, a StaticMesh from this Pickable given its custom ID
entity:RemoveStaticMeshAttached(id)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | id | Unique ID of the StaticMesh to remove |

SetAttachmentSettings
β
Sets the Attachment Settings for this Pickable (how it attaches to the Character when Picking up)
entity:SetAttachmentSettings(relative_location, relative_rotation, socket)
Type | Parameter | Default Value | Description |
---|---|---|---|
Vector | relative_location | Relative location to the Socket | |
Rotator | relative_rotation | Rotator() | Relative rotation to the Socket |
string | socket | hand_r_socket | Character Socket to attach |

SetCrosshairMaterial
β
Sets the crosshair material for this Pickable
entity:SetCrosshairMaterial(path)
Type | Parameter | Default Value | Description |
---|---|---|---|
string | path | Asset path to the crosshair material |

SetPickable
β
Sets if this Pickable can be grabbed
entity:SetPickable(is_pickable)
Type | Parameter | Default Value | Description |
---|---|---|---|
boolean | is_pickable |

GetAssetName
β
Gets the name of the asset this Pickable uses
entity:GetAssetName()

GetHandler
β
Gets the Character, if it exists, that's holding this Pickable
entity:GetHandler()
Eventsβ
Name | Description | |
---|---|---|
Drop | When a Character drops this Pickable | |
Hit | When this Pickable hits something | |
Interact | When a Character interacts with this Pickable | |
PickUp | When a Character picks this up | |
PullUse | When a Character presses the use button for this Pickable (i.e. clicks left mouse button with this equipped) | |
ReleaseUse | When a Character releases the use button for this Pickable (i.e. releases left mouse button with this equipped) |
Drop
β
When a Character drops this Pickable
Weapon.Subscribe("Drop", function(self, character, was_triggered_by_player)
-- called when any weapon is dropped by a Character
end)
Type | Parameter | Description |
---|---|---|
Pickable | self | The Pickable which has been dropped |
Character | character | The Character that dropped it |
boolean | was_triggered_by_player | If the Player actively pressed 'G' to drop |
Hit
β
When this Pickable hits something
Weapon.Subscribe("Hit", function(self, impact_force, normal_impulse, impact_location, velocity)
-- called when any weapon hits something
end)
Type | Parameter | Description |
---|---|---|
Pickable | self | The Actor that was hit |
number | impact_force | The intensity of the hit normalized by the Pickable's weight |
Vector | normal_impulse | The impulse direction of the hit |
Vector | impact_location | The world space location of the impact |
Vector | velocity | The Pickable's velocity at the moment it hit |

Interact
β
When a Character interacts with this Pickable (i.e. tries to pick it up)
return false to prevent the interaction
Type | Parameter | Description |
---|---|---|
Pickable | self | The Pickable that just got interacted with |
Character | character | The Character that interacted with it |
PickUp
β
When a Character picks this up
Weapon.Subscribe("PickUp", function(self, character)
-- called when any weapon is picked up by a Character
end)
Type | Parameter | Description |
---|---|---|
Pickable | self | The Picable that just got picked up |
Character | character | The Character that picked it up |
PullUse
β
When a Character presses the use button for this Pickable (i.e. clicks left mouse button with this equipped)
Weapon.Subscribe("PullUse", function(self, character)
end)
Type | Parameter | Description |
---|---|---|
Pickable | self | The Pickable which has just been used |
Character | character | The Character that used it |
ReleaseUse
β
When a Character releases the use button for this Pickable (i.e. releases left mouse button with this equipped)
Weapon.Subscribe("ReleaseUse", function(self, character)
end)
Type | Parameter | Description |
---|---|---|
Pickable | self | The Pickable which has just stopped being used |
Character | character | The Character that stopped using it |
Available Crosshairsβ
nanos world provides a bunch of crosshair materials which can be used in Weapons/Pickables. You can of course create your own crosshair materialr and use those instead!


List of crosshair materials included in the default asset packβ
nanos-world::MI_Crosshair_Circle
nanos-world::MI_Crosshair_Crossbow
nanos-world::MI_Crosshair_Dot
nanos-world::MI_Crosshair_Holo
nanos-world::MI_Crosshair_Launcher
nanos-world::MI_Crosshair_Regular
nanos-world::MI_Crosshair_Regular_X
nanos-world::MI_Crosshair_Rocket
nanos-world::MI_Crosshair_Separated_Triangle
nanos-world::MI_Crosshair_Shotgun
nanos-world::MI_Crosshair_Square
nanos-world::MI_Crosshair_Submachine
nanos-world::MI_Crosshair_Tee
nanos-world::MI_Crosshair_ThreeDots
nanos-world::MI_Crosshair_Triangle
nanos-world::MI_Crosshair_Vee