Giter VIP home page Giter VIP logo

combatcharactercontroller's Introduction

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

combatcharactercontroller's People

Contributors

johnmoney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.