INTRODUCTION
One of the core gameplay features in my Unreal Engine 5 project was creating a responsive and scalable weapon combat system.
The goal was to allow characters to equip weapons dynamically, trigger combat animations, and apply damage through collision-based combat logic.
SYSTEM GOALS
The combat system was designed to:
• Equip and unequip weapons
• Attach weapons using sockets
• Trigger attack montages
• Detect weapon overlaps
• Apply damage during attack windows
• Support future weapon types
EQUIPPING WEAPONS
Weapons are attached directly to character sockets using AttachToComponent.
This allowed the weapon to follow character animations correctly during gameplay.
CODE EXAMPLE
ATTACK SYSTEM
Attack inputs trigger animation montages through the character combat system.
The montage controls attack timing and animation blending.
CODE EXAMPLE
WEAPON COLLISION
To detect hits, collision overlap events are enabled only during active attack frames.
This prevents unwanted damage outside combat windows.
CODE EXAMPLE
DAMAGE LOGIC
When the weapon collides with a valid target, the system applies gameplay damage.
Friendly-fire checks are also supported through team-based validation.
CODE EXAMPLE
RESULT
The final combat system created responsive melee gameplay while keeping the code modular and scalable.
The system now supports:
• multiple weapon types
• combo attacks
• enemy combat
• future RPG mechanics
• scalable gameplay expansion
WHAT I LEARNED
Through this system, I improved my understanding of:
• Unreal Engine combat architecture
• animation montages
• gameplay collision systems
• socket-based equipment
• modular gameplay programming
