Melee Combat System
  • Melee Combat System
  • Quick Start
  • Weapon
  • Attack
  • Reaction
  • Input Manager
  • Parkour Integration
  • Playable Demo
  • Custom Animation Event
Powered by GitBook
On this page

Weapon

PreviousQuick StartNextAttack

Last updated 8 months ago

The WeaponData ScriptableObject is a comprehensive data container designed to manage all aspects of a weapon. This centralizes the configuration of weapon properties, animations, and behaviors, providing a flexible way to define and control weapon functionality

Create Weapons

You can create a weapon by going to Create > Combat System > Create Weapon.

Weapon Data

General Weapon Settings:

  • Spawn Weapon: A boolean that determines if the weapon should be instantiated and attached to the character.

  • Weapon Holder: Specifies the bone in the character's skeleton (e.g., RightHand) where the weapon will be attached.

  • Local Position & Rotation: The position and rotation of the weapon relative to the weapon holder, allowing for precise placement and orientation.

Attack Data:

  • Attacks: A list of Attacks, each defining an attack's data and conditions.

  • Heavy Attacks: A separate list for attacks that are categorized as heavy

  • Attack Type: The type of the attack (e.g., Single, Combo, Stealth, Grounded).

Conditions:

  • Minimum Distance: The minimum distance for the attack to be effective.

  • Maximum Distance: The maximum distance for the attack to be effective.

  • Health Threshold: The attack will only be triggered if the target's health is below this threshold, expressed as a percentage.

  • Rootmotion Distance: Click this button to get the attack root motion distance, which helps set the minimum and maximum distance for the attack.

Attack:

  • Attack: Data for the specific attack.

  • Can Be Charged: Indicates if this attack can be charged.

  • Charged Attack: Data for the charged version of the attack.

Reaction Data:

  • Reaction Data: Handles the responses triggered by specific tags or directions with the weapon

  • Block Reaction Data: Separate data for reactions specific to blocking, ensuring that the weapon responds appropriately in defensive scenarios.

Blocking Mechanics:

  • Can Block: A boolean indicating if the weapon can block incoming attacks.

  • Blocking Animation: The animation clip used when blocking.

  • Blocked Damage: A float value that defines the percentage of damage taken while blocking.

  • Block Reaction Data: Data for the reactions that occur when the weapon is used to block.

  • Block Mask:AvatarMask to use during blocking.

Counter Mechanics:

  • Can Counter: Indicates if the weapon can perform counterattacks.

  • Play Action If Counter Misused: If true, the fighter will play a taunt action if the counter input is pressed while the enemy is not attacking. This can be used to prevent the misuse of the counter input.

  • Counter Misused Action: Animation clip of the action to play if the counter is pressed while the enemy is not attacking.

Equip Weapon:

  • Weapon Equip Animation: Defines the animation that plays when the weapon is equipped

  • Weapon Activation Time: The time taken to activate the weapon.

  • Weapon Equip Sound: The sound effect that plays when the weapon is equipped.

Unequip Weapon:

  • Weapon Unequip Animation: Defines the animation that plays when the weapon is unequipped.

  • Weapon Deactivation Time: The time taken to deactivate the weapon.

  • Weapon Unequip Sound: The sound effect that plays when the weapon is unequipped.

Advanced:

  • Animator Override Controller: Manages different movement animations specific to the weapon, allowing for customized animation transitions based on the weapon equipped.

  • Use Rootmotion: When enabled, root motion drives the character’s movement animation data. This only works if the player is in a combat stance

  • Override Move Speed: Indicates if the locomotion movement speed should be overridden.

  • Walk Speed, Run Speed, Sprint Speed: Configure these speeds to control how the character moves at different paces.

  • Combat Move Speed: Adjusts the speed specifically for combat mode, influencing how the character circles a target when in a locked-on combat stance.

  • Weapon Holding Clip: Animation that keeps the weapon correctly positioned during movement.

  • Weapon Holder Mask: Applies an AvatarMask to focus the holding animation on the relevant parts of the character’s body, ensuring that the weapon appears correctly during all movements

  • Min Attack Distance: Minimum distance required for the weapon to effectively engage and impact targets during an attack.