Posted February 01, 2022 by NyanYann
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.
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.