Greetings! In this post, I would like to discuss a few tweaks I have made to the combat system to enhance its appearance and overall gameplay experience.
Okay, tell us or show us!
Upon observing the combat in various games, I noticed that the attacks in my game lacked the necessary weight and impact while swinging a sword or thrusting with a lance. However, the issue was that I didn’t want to redo the animations as I’m not skilled in character animation. So, I brainstormed a code-based solution to address this problem.
Which is?
Before proceeding, let’s take into account some initial points:
- Our body adjusts its posture to maintain balance while moving.
- Swinging a sword involves rotating the body in the direction of the swing.
- The forward velocity of the swing or thrust affects the body’s movement.
Instead of altering the animations themselves, I decided to modify the character’s position and rotation based on their current attack. By doing so, the whole process becomes much more realistic without the need to touch the animations.
What about the implementation?
At present, my combat system operates using animation events to modify the character’s rotation and velocity. These events are used during the animation, and the new values are saved in character-specific scriptable objects. This approach creates space for additional enhancements to be made in the future.
Bottom Line
I believe my decision to avoid modifying the animations and instead implement code-based adjustments was the right one. These modifications are crucial to infuse more vitality into the character and elevate the combat experience, which can greatly enhance the overall aesthetics and immersion of the game.