-
Notifications
You must be signed in to change notification settings - Fork 2
README

Enables directional attack animations (high, low, left, right) with an onscreen directional indicator controlled by mouse movement when the left mouse button is depressed. Release button to perform the attack. Directional damage is supported with out-of-the-box DamageableHitBox.
The overall design goal of this addon was to be minimally invasive to the Kit, repurposing the random attack animations with the player selected attack direction.
The character controller is based on the MMORPG Kit ShooterPlayerController as was tested with Kit release 1.72c5.

A demo is provided to showcase Combat (MMO only). You will need to first download the free asset Melee Axe Pack to get the additional directional attack animations needed.
- ensure the following OneHandSword animations are referenced in Right Hand Attack Animations on the CombatFemale and/or CombatFemale_CC prefabs:
- Element 0: standing_melee_attack_downward
- Element 1: standing_melee_attack_backhand
- Element 2: standing_melee_attack_360_high
- Element 3: standing_melee_attack_horiztonal
- add Combat-00Init_MMO and Combat-Map001 scenes to top of Build settings
- build and launch server
- run Combat-00Init_MMO_ClientOnly and create character with CombatFemale race
For existing builds, you need to make the following changes to enable Combat.
Controller
Replace reference to PlayerCharacterController in GameInstance component found in Init scenes. You can alternatively set the Contoller prefab directly in the Player Character Entity in the player prefab.

Player prefab
- replace DefaultCharacterAttackComponent component with CombatCharacterAttackComponent.

- add weapon animations in the same order as the CombatAnim enum (High, Low, Left, Right) in Character Model component.

- remove any default Charge state animations in Character Model (currently not supported).
Weapon Items
Modify Equipment settings to hide Crosshair and Fire type: Fire on Release.

Character and Monster prefabs
If you want to add directional damage, add a Unity Ragdoll to the models (GameObject > 3D Object > Ragdoll) and CombatDamageableHitBox to all bones with colliders. This is out-of-the-box Kit functionality. You can adjust the Damage Rate by location accordingly, for example 2 on the head bone, 0.01 for shield, etc. The CombatDamageableHitBox adds Combat text which can optionally be displayed, for example on a Headshot, Block with shield or Backstab.

Combat has two settings found on the GameInstance component:
- Enable Rigid Body Combat Attack
- UI Combat Text String (utility to display any string as Combat Text)
- arrow icon by jojooid at Flaticon