So there are two particular things that still bug me. They both involve getting very close to an enemy in combat.
A quick aside… I’ve made lots of improvements for my project with this course as the base. I am incredibly grateful for this course. It really upped my skills and I am doing things now that I don’t even believe. I’ve added more states, tweaked things, added sound effects in a fairly intuitive way… all while hopefully not spaghettifying my code too badly for when I have to overhaul it to work with different equipable weapons and enemy behaviors.
The first thing is that when you get right up to an enemy, you can move REALLY fast. It bothered me from the moment we set up the targeting cam. I had hope when we had the lecture that addressed something here but it was merely the camera wiggle. I’m curious if there are any easy fixes to even just hack this to where you aren’t spinning around a point so closely. It is just physics so I get WHY it SEEMS like you are moving much faster than usual. And I believe the root cause (being able to get so close in the first place) is related to my other big annoyance…
You can cheese enemies by getting as close as possible to them. Even with generous weapon hitboxes you can generally have the enemy swing miss if you get right up on them. It can also confuse their LookAt function. I went back and Smoothed out the LookAt since I had a note there that it appeared we were going to come back and do that but we never did. I lerp it out and I also still have a function to snap right to if needed. The problem is if you get right behind the enemy and super close it won’t smoothly get there at all. I can go behind the enemy but not right up on them and they seem to rotate just fine though…
Anyway, I think fixing how close a player can get would likely fix both these issues. It doesn’t seem feasible to increase the character controller radius on either enemy, player, or both. Maybe an extra capsule around the enemies as a trigger to somehow inhibit forward motion from the player? That seems like it would be twitchy and bad. A physical collider that only interacts with another physical collider of the same layer maybe? A “force-field” layer that is just bubbles around all combatants that only bump against each other? Might work but could also spawn unintended side effects.
I’m open to about anything. I’ve got plenty of things in the project to keep me busy, but I REALLY want to get my combat nailed down to near perfection before I start on other systems. Like… fully working and just some final polish with animations and visuals to be done finished.
EDIT for clarity… I have solved these concerns with a two pronged approach. Better hitbox area with another collider on a separate layer which allows movement to still be unrestricted and on the original character controller radius value. Then just a simple distance check with a modifier for speed for the player when they get too close to their target.