Batman Like Counter (Full Project)
In creating the counter system reminiscent of the Batman games within Unreal Engine, I embarked on a journey of blending animation intricacies with precise gameplay mechanics. Here's a breakdown of how I brought this dynamic feature to life:
Firstly, I imported a set of animations capturing the essence of combat: the player's striking motions from various angles and the corresponding reactions of the enemy to being attacked.
When it comes to the nitty-gritty of gameplay mechanics, I tackled the challenge of timing and precision. Within the event damage function, I devised a method tailored to the player's input: if the player executes a timely left-click during the enemy's attack, they engage in a counteraction. Otherwise, they sustain damage.
The heart of the counter calculation lies in orchestrating seamless animation transitions based on the enemy's position relative to the player. To achieve this, I strategically placed scene components around the player, each representing a distinct combat zone – left, right, front, and back. By measuring the distance between the enemy and these designated zones, I determined the optimal location for executing the counter move.
Once the ideal position was pinpointed, I synchronized the player's orientation with the chosen direction, ensuring a visually cohesive experience. For instance, if the counter involved a backward strike, the player dynamically shifted their focus away from the adversary before initiating the animation sequence.
With the stage set, I orchestrated a series of actions to seamlessly execute the counter maneuver. This involved temporarily disabling the enemy's collision to prevent interference, positioning them appropriately, and triggering the paired animations to synchronize the player's movements with the enemy's reactions. Upon completion, the enemy was gracefully transitioned into ragdoll mode, adding a touch of realism to the encounter.
In essence, crafting this counter system wasn't just about coding logic; it was about choreographing a dance of animations and interactions to immerse players in the adrenaline-pumping thrill of combat, reminiscent of the iconic style seen in the Batman games.