Hello everyone,
I am currently working on a fighting game in Unreal Engine 5.4, and I’ve encountered a baffling little bug.
To summarize my situation, I have one custom player pawn that is able to create hitboxes, and have collision detection code tied to an OnOverlap event that handles both player and hitbox collision logic. Both players are an instance of this one player pawn class, so the logic should be consistent in the way that it operates between both pawns.
When the players are a considerable distance away from each other, the hitboxes resolve correctly, the hit player enters the hitstun state and takes damage as expected; however, when the players are close, the logic for the hit resolution logic fires, but the player does not enter the hitstun state or takes damage as expected as shown in the first screenshot. Worth noting is my debug PrintString does fire to prove that the logic does fire as expected, as shown in the second screenshot.
Worth noting is that, in the second case, the players should, in theory, not be overlapping due to how the collision code is implemented (unless there is something I am fundamentally not understanding about the OverlapBegin event). Why would the hitbox resolution logic fire both when the players are spaced out and close (potentially not touching) but will only update when there is a good amount of space between both players? Below I have posted the collision code, if it helps.
Thank you so much for taking a look at this problem.