💣 Grenade
Chad Grenade
info
Usage
local new_grenade = Grenade(
Vector(-900, 185, 215),
Rotator(0, 90, 90),
"nanos-world::SM_Grenade_G67",
"nanos-world::P_Grenade_Special",
"nanos-world::A_Explosion_Large"
)
Constructor Parameters
Type | Name | Default |
---|---|---|
Vector | location | Vector(0, 0, 0) |
Rotator | rotation | Rotator(0, 0, 0) |
StaticMesh Asset | static_mesh_asset | "nanos-world::SM_Grenade_G67" |
Particle Asset | explosion_particles | "nanos-world::P_Grenade_Special" |
Sound Asset or Special Path | explosion_sound | "nanos-world::A_Explosion_Large" |
CollisionType | collision_type | CollisionType.Normal |
boolean | gravity_enabled | true |
tip
nanos world provides a special Particle* called nanos-world::P_Grenade_Special
which spawns different particles depending on the surface it explodes, and also if is underwater.
*This "Particle" is just a special identifier which can only be used on Grenades!
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 Pickable 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 |
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 | |
---|---|---|---|
Explode | Forces this grenade to Explode | ||
SetDamage | Sets Damage parameters of this Grenade | ||
SetTimeToExplode | Set Time until Explosion after thrown | ||
SetThrowForce | Set Impulse applied when throwing | ||
![]() | number | GetBaseDamage | Damage at Inner Radius |
![]() | number | GetDamageFalloff | Radius which BaseDamage will apply proportionally |
![]() | number | GetDamageInnerRadius | Radius which MinimumDamage will apply |
![]() | number | GetDamageOuterRadius | Radius which BaseDamage will apply |
![]() | number | GetMinimumDamage | Damage at Outer Radius |
![]() | number | GetTimeToExplode | Time until Explosion |
![]() | number | GetThrowForce | Impulse applied when throwing |

Explode
Forces this grenade to Explode
my_grenade:Explode()

SetDamage
Sets Damage parameters of this Grenade
my_grenade:SetDamage(base_damage, minimum_damage, damage_inner_radius, damage_outer_radius, damage_falloff)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | base_damage | 90 | Max damage when inner radius |
number | minimum_damage | 0 | Min damage when outer radius |
number | damage_inner_radius | 200 | Radius which damage will be 100% |
number | damage_outer_radius | 1000 | Radius which damage will be interpoled through falloff |
number | damage_falloff | 1 | Lerp function between Max and Min damage |
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() |
Inherited Pickable 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) |
Name | Description |
---|---|
Explode | Grenade has exploded |
Throw | Grenade has been thrown |
Explode
Triggered when the has exploded
Grenade.Subscribe("Explode", function(self)
-- called when a grenade explodes
end)
Type | Parameter | Description |
---|---|---|
Grenade | self | The grenade which exploded |
Throw
Triggered when the has been thrown
Grenade.Subscribe("Throw", function(self, handler)
-- called when a grenade is thrown
end)
Type | Parameter | Description |
---|---|---|
Grenade | self | The grenade which has been thrown |
Character | handler | The Character which has thrown |