
Build a modular, data-driven third-person melee system in Unity with combos, counter attacks, and intelligent AI that circles and attacks in coordination, using scriptable ingenuity and a finite state machine.
Learn how to ask questions effectively while building a melee combat system in Unity and C#. Use the course Q&A, join the Discord, and share video demonstrations for complex issues.
Build a third person controller from scratch to learn the fundamentals of gameplay programming, including animation root motion and root transforms, for a melee combat system in Unity.
Set up a new Unity project with the 3D URP template, create a test scene, add a ground plane, and apply a checker material while starting the melee combat system.
Create a third-person camera in Unity that follows the player, rotates with the mouse, clamps tilt, uses a framing offset to look at the chest, supports inversion and cursor locking.
Create camera-relative third-person movement in Unity by importing a mixamo fbx character, extracting textures, and using a player controller with planar rotation and smooth quaternion.RotateTowards.
Set up idle, walk, and run animations for a Unity melee system by using humanoid retargeting with Mixamo, creating avatars, and disabling root motion to let code drive movement.
Add character animations in Unity with an animator controller and blend tree to smoothly blend idle, walk, and run based on move amount, using clamped, damped parameters and avatar setup.
Use a character controller to handle collisions, and implement gravity by manually checking the ground with a sphere and a layer mask, then move with the controller.
Set up Unity controller input to move with the left stick and rotate the camera with the right stick, by adding camera X/Y inputs and mapping mouse and joystick axes.
Build a modular melee combat system in Unity by importing a sword slash from Mixamo, configuring an overwrite animator layer, and using a coroutine to handle attack timing and input.
Create a Unity and C# melee system by adding a sword spot to the player's hand and a hit reaction animation for enemies when struck.
Define a three-state melee attack system in Unity and C# using windup, impact, and cooldown delays, enabling the sword collider only during impact to prevent false hits and enable combos.
Architect attacks with scriptable objects to let designers add multiple attacks and build combos via an attacks list, replacing hard-coded values with animation names and start-end times.
Build a melee combat system in Unity and C# by adding hand and foot hitboxes and enabling the correct hitbox per attack, such as Spartak using the right foot.
Develop a scalable enemy AI in Unity using a generic state machine, with idle and chase states as separate classes that implement enter, execute, and exit.
Implement a vision sensor with a sphere collider to detect the player within range and field of view, then use a navmesh agent to chase with stopping distance and animations.
Implement combat movement where enemies chase, stand in a guarded idle, or circle the player, using a combat movement state with idle, chase, and circling, and smooth transitions.
Develop a melee combat system in Unity and C# that makes enemies randomly circle the player during combat movement, using timers, random ranges, and a left-right circling animation blend.
Replace transform rotate around with navmesh agent move to circle the player, handle obstacles and other enemies, and drive animations with forward and strafe velocity via a 2d blend tree.
Implement a Unity and C# melee combat system where enemies chase the player and attack one at a time using a singleton enemy manager and an attack state.
Create a retreat after attack using a backward walk animation and a navmesh retreat state; ensure the enemy faces the player and switches back at three meters.
Enable enemies in Unity to perform single and random combo attacks by using a combo count, cooldown checks, and a random selection from available attacks via a public list.
Learn to implement counter attacks in Unity and C# by pairing attacker and victim animations from Mixamo, defining a wind-up counter window, and handling animator states, rotations, and death logic.
Develop a Unity and C# melee targeting system that selects the closest enemy in the camera direction and highlights it with a glow shader, updating every 0.1 seconds.
Implement lock-on combat mode in Unity and C#, enabling the player to target enemies, face the target, and strafe while moving, triggered by input or attacks, with bug fixes.
Learn directional attacks and rotation in combat: have your player face attackers during hit reactions, attack toward chosen directions, and target enemies using the forward direction and closest-enemy logic.
Map attack to the X button and enable lock-on with the left trigger in Unity, using a custom joystick helper to detect axis presses for combat.
Learn to stun enemies after taking a hit by implementing a getting hit state, using action delegates and events, and refining target finding for robust combat in Unity and C#.
Add long range attacks to a Unity and C# melee system using a Mixamo spin slash animation, distance checks, and movement toward the target via a scriptable object for attack.
Enhance melee system by moving only during an attack window with move start and end times and normalized time, and ensure single-target hits by tracking current target and player position.
Enhance melee combat with edge-case fixes such as null checks and stopping coroutines on hit, enable movement toward targets, ensure long-range attacks exist before use, and dynamically target the attacker.
Implement a health system in Unity to handle taking damage and dying for both player and enemy, with a reusable take damage method, clamped health, and death reactions.
Implement an alert mechanism where enemies notify nearby foes when spotting a target in a Unity melee system using C#. Use overlap box, alert range, and shared targeting.
In this course, you’ll learn to create a third-person melee combat system in Unity with features like combos, counterattacks, intelligent enemy AI, etc. We'll design this system in a modular, data-driven, and scalable way using clean coding practices. So in this course, you’ll not only learn to build this system, but you’ll also learn lots of valuable game programming concepts that you can use throughout your career
So the combat system that we’re going to create will be a free-flow combat system. That means enemies won’t attack the player mindlessly; instead, they’ll attack in a coordinated way by circling the player and attacking one at a time. This is the type of combat used in modern-day games like Assassin's Creed, Batman Arkham series, Marvel’s Spider-Man, etc. This combat system will also be easily customizable, so if you want to use punch and kick attacks instead of sword attacks, you can do that easily without changing a single line of code
So we’ll be building all this step-by-step from scratch. We’ll start by making a basic third-person controller. We’ll not use any assets for it; we’ll build it from scratch because it’s a good way to learn the fundamentals of gameplay programming. And then we'll give our character the ability to attack. We’ll architect the attacks using scriptable objects in Unity so that the designer will be able to create and edit different attack combos without changing the code. Then we'll start building the enemy AI. We'll be architecting the enemy AI using a finite-state machine. It's a technique that’s been used for building AI in games for the last 25 years. It's used in popular games like Last of Us, the Batman Arkham series, and many more. So we'll build a Finite-State Machine from scratch and create our enemies using it. We'll start by creating simple enemy behaviors like Idling and Chasing the player, then we'll implement more advanced behaviors like circling the player and attacking him in a coordinated way. Once we're done with the Enemy AI, we'll implement the counterattacks.
Throughout this course, you’ll learn lots of game programming skills. You’ll learn lots of intermediate-level C# concepts like Generic Classes, Dictionary, LINQ, Inheritance, etc. You’ll also learn to use Mathematical concepts like Trigonometry, Dot Product, Cross Product, etc. So the skills and techniques that you learn from this course will be really helpful for you if want to pursue a career as a game programmer.