A smart directional dodge system built entirely in C++ that evaluates the character's surroundings and picks the best escape route, avoiding obstacles and enemies. Instead of dodging in a fixed direction, the system samples multiple directions using capsule sweeps, scores each by obstacle clearance (30%) and enemy avoidance (70%), and slides the character along the highest-scoring path.
The movement uses CharacterMovementComponent velocity override rather than LaunchCharacter to prevent the character from being “sent flying” when close to enemies. An ease-out curve provides smooth deceleration, and velocity is zeroed before and after dodge for clean transitions. Directional animation montages are automatically selected by mapping the dodge direction to forward/back/left/right quadrants relative to the character's facing.
Configurable settings include dodge distance, duration, cooldown, air dodge toggle, trace radius, number of sampled directions, enemy detection radius, and minimum clear distance threshold. The component attaches to any character and exposes a clean Blueprint API with events for dodge started, completed, and failed states.


