Randolphjand / CombatCharacterController

Enables directional attack animations (high, low, left, right) for ShooterPlayerController

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Combat Character Controller

combatcharactercontroller

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 and was tested with Kit release 1.76d2.

Demo

combatcharactercontroller_build

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.

  1. ensure the following OneHandSword animations are referenced in Right Hand Attack Animations on the Female_Combat and/or Female_CC_Combat 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
  1. add 00Init_MMO_Combat and Map001_Combat scenes to top of Build settings
  2. build and launch server
  3. run 00Init_MMO_ClientOnly_Combat and create character with Female_Combat race

Setup

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.

combatcharactercontroller_instance

Player prefab

  1. replace DefaultCharacterAttackComponent component with CombatCharacterAttackComponent.

combatcharactercontroller_attack

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

combatcharactercontroller_weapon

  1. 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.

combatcharactercontroller_weaponitem

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.

combatcharactercontroller_hitbox

Settings

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)

Credits

  • arrow icon by jojooid at Flaticon

About

Enables directional attack animations (high, low, left, right) for ShooterPlayerController

License:GNU General Public License v3.0


Languages

Language:C# 100.0%