Melee Attack

marcintr1994

New member
Hi, I’ve got a problem with Melee Attack. I’m using the Ultimate Inventory System demo and I’d like to add an extra attack. I added a script that reuses the data from the default Melee Attack (from each sword), doubles the attack stats, and adds a special effect, sound, and cooldown, while using the same animation as the basic attack. Everything works fine on the player — both the basic and the stronger extra attack — but the problem starts with enemies: the enemy runs up to the player and then just stands there without attacking. So something in the logic must have broken. I’ll attach the scripts. How else could I handle this? Is it okay for me to modify MeleeAttack.cs and EnemyCharacter.cs?
 

Attachments

Hey marcintr.
The demo scripts like Player, EnemyCharacter, MeleeAttack, etc... Are simply examples for you to inspire yourself from. I recommend not editing them directly, but instead make your own by copy pasting the logic that is relevant to you.
For non-demo code I recommend making subclasses instead of copy pasting as those were designed to be modular and extendable.

Note that upgrading the Ultimate Ivnentory Sytem pacakge will override ALL changes you made to those scripts as they will be replaced by the one coming from the package.
 
Back
Top