Update 0.4 - Melee combat !
New combat system!
This update contains a simple close combat system. Now an entity can have two different types of attacks, either a ranged attack with a gun or a melee weapon like a sword.
In order to use the close combat attack system with an entity, it needs to have a CloseCombatConfig as its AttackConfig (In its CharacterStatsHandler component). A CloseCombatConfig is really similar to a ShootConfig in how it works.
- The size will change the scale of the weapon object (a sword for example)
- The delay is the time between two attacks
- The power is the amount of damage dealt by the attack
- The speed indicates the movement speed of the weapon object (the swing speed for example)
- The target allows you to specify the layer on which the attacks can deal damage
- The swing angle is exclusive to close combat attacks, it's simply the angle of the swing of the attack.
- The thrust distance is how much the weapon object will move forward when attacking
- The two curves allows you to fine tune the movements of both the swing and thrust of the weapon.
Tweaking those values can allow you to create various attack patterns like those :
The other thing you need for this system to work properly is a TopDownCloseCombat component attached to your entity, you now only need to provide a prefab who will be your weapon object. This object needs at least a collider 2D set as a trigger, and a CloseCombatController component to animate the attack.
Files
Get 2D Top down controller for Unity
2D Top down controller for Unity
A Unity package for 2D movements and attacks on a top down setting
Status | Released |
Category | Assets |
Author | NyanYann |
Tags | 2D, Controller, Singleplayer, Project template, Top-Down, Top down shooter, Unity |
More posts
- Update 0.6 - DocumentationMar 04, 2022
- Update 0.5 - Added support for Unity 2019.3 and moreFeb 15, 2022
- Update 0.3 - Sample project updateJan 26, 2022
Leave a comment
Log in with itch.io to leave a comment.