Combat Magic System (Using Grub) and HUD In Unity

The combat magic system allows the game character to cast projectiles from specified bones in the skinned mesh hierarchy, a custom HUD was also created to show what weapons or spells, and which combat mode the character currently is in.

If a spellbook is equipped, that spell can be cast, a maximum of 2 simultaneous magic projectiles may be cast, and there is also a magic block spell, which will allow the character to block magic and normal weapons damage.

When the projectile is out of a specified range from where it was fired, or when it hits anything that has a rigid body, and is not the original spell castor, the projectile will instantiate an explosion prefab, and use an overlapping sphere, to apply an explosion force to all nearby rigid bodies.


For this demonstration, simple crates were created for testing the explosion force that emits from a hit of a magic projectile, objects that were the closet hit will actually be completely destroyed.


A Custom HUD was also created, to show what combat mode the character is currently in, namely Unarmed, Weapons or Magic. And then it also shows the characters current Health and available magic, which will deplete as spells are being casted, magic regenerates over time, then more spells can be casted. The HUD will also show with icons, which weapons or spells are currently equipped, like Sword, Shield, Fire spell, Ice Spell or a Block Spell.


This video shows more detail in the Unity Scene view.


Leave a Reply