πͺ Melee
A Melee represents an Entity which can be Pickable by a Character and can be used to melee attack, Charactes can hold it with hands with pre-defined handling modes.
info
Usageβ
local crowbar = Melee(
Vector(-900, 185, 215),
Rotator(0, 90, 90),
"nanos-world::SM_Crowbar_01",
CollisionType.Normal,
true,
HandlingMode.SingleHandedMelee,
""
)
crowbar:SetScale(Vector(1.5, 1.5, 1.5))
crowbar:SetAnimationCharacterUse("nanos-world::AM_Mannequin_Melee_Slash_Attack")
crowbar:SetDamageSettings(0.3, 0.5)
crowbar:SetCooldown(0.5)
crowbar:SetBaseDamage(40)
Constructor Parametersβ
Type | Name | Default |
---|---|---|
Vector | location | Vector(0, 0, 0) |
Rotator | rotation | Rotator(0, 0, 0) |
StaticMesh Asset | asset | |
CollisionType | collision_type | CollisionType.Normal |
boolean | gravity_enabled | true |
HandlingMode | handling_mode | HandlingMode.Torch |
Material Asset | crosshair_material | |
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 | |
---|---|---|---|
SetAnimationCharacterUse | Sets the Animation when attacking | ||
SetSoundUse | Sets the Sound when attacking | ||
SetBaseDamage | Sets the Base Damge | ||
SetDamageSettings | Sets the Damage Settings (activation damage time/duration) | ||
SetCooldown | Sets the Cooldown between attacks | ||
![]() | string | GetAnimationCharacterUse | Gets the attack Animation |
![]() | string | GetSoundUse | Gets the Attacking Sound |
![]() | number | GetBaseDamage | Gets the Base Damage |
![]() | number | GetCooldown | Gets the Cooldown |

SetAnimationCharacterUse
β
Sets the Animation when attacking
my_melee:SetAnimationCharacterUse(asset_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
Animation Asset | asset_path | The Animation used when attacking |

SetSoundUse
β
Sets the Sound when attacking
my_melee:SetSoundUse(asset_path)
Type | Parameter | Default Value | Description |
---|---|---|---|
Sound Asset or Special Path | asset_path | The Sound used when attacking |

SetBaseDamage
β
Sets the Base Damage
my_melee:SetBaseDamage(damage)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | damage | The Base Damage value |

SetDamageSettings
β
Sets the times when to start applying damage and when to end. During this time the collision of the melee will be enabled and the damage will be applied if it hits something
my_melee:SetDamageSettings(damage_start_time, damage_duration_time)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | damage_start_time | The initial time to start applying damage | |
number | damage_duration_time | The duration time to stop applying damage |

SetCooldown
β
Sets the cooldown between attacking
my_melee:SetCooldown(cooldown)
Type | Parameter | Default Value | Description |
---|---|---|---|
number | cooldown |
GetAnimationCharacterUse
β
Gets the animation asset
Returns string
my_melee:GetAnimationCharacterUse()
GetSoundUse
β
Gets the sound asset
Returns string
my_melee:GetSoundUse()
GetBaseDamage
β
Gets the base damage
Returns number
my_melee:GetBaseDamage()
GetCooldown
β
Gets the cooldown
Returns number
my_melee:GetCooldown()
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) |