Hey!, I’m trying to make a combat system for an rpg with attacking, blocking but I’ve had no luck finding any tutorials can someone please help me make a combat system in blueprint or at least show me a tutorial or documents for something similar.
thats a complicated question, you should probably break the problem down a bit more into parts that you want to learn.
first, make a character perform an animation on command:
then, make collision box components that deal damage:
each attack can set the relative location and box extent of your hit box, as well as setCollisionEnabled to toggle whether it registers hits, and on overlap, you can apply damage to the actor, or you can call an interface function that tells the actor that they were hit. in the actor that was hit, in the definition of their interface event, you can check if they are blocking with a boolean or by checking what state they are in.
you will want to make some kind of state machine to keep track of what state the characters are in. you can use an enum or a name to keep track of this in the event graph, or you can use a skeletal mesh state machine graph.
when dealing damage, you may want to calculate the damage based on player stats and formulas. something like player level multiplied by weapon damage minus enemy level multiplied by enemy armor defense.
some attacks will be upper body attacks, full body attacks, root motion attacks, or they may even trigger their own cutscene.
then there are combo systems (anim notifies + state machine), lock on targeting (vector math, using dot product to set closest enemy reference, rotating camera/player orientation), sound effects (anim notifies, play sound at location), camera animations, UI(widget components for health bar and damage toast), item drops (on destroy, spawn physics pickup), ragdolling enemies (simulatePhysics), particle effects, etc…