Collision detection fails on specific frames of a specific (legacy) animation.

I have a sword, with legacy animations for different attacks. Nested within the sword’s children are two overlapping collision detectors, gameobjects with box colliders, kinematic rigidbodies, and scripts for sending information about what was hit. The two hitboxes essentially do the same thing for now, but I decided to include the fact that there are two in case that could be used to determine my problem.

Now, when the sword hits an object while it is not in its default holding animation, the script on the hitbox should let a script on the sword know so that it can preform the result of a succesful attack. This works fine for almost all of my different attacks/attack animations, except one.

An attack called smash, where the the sword begins in an upright position and is swung down about 90 degrees until it is horizontal. The swinging motion occurs over about frame 10 to frame 15.
Because of this, ive set the sword script to only preform the result of a sucessful attack if it is registered from frame 10 to frame 15

My problem is that sometimes the hitbox doesn’t register during the smash attack, seemingly for no reason. However, i’ve determined through vigorous debugging that when the hitboxes dont register, they actually register immediately after frame 15. Which is exactly when the sword animation begins to rest at a horizontal position. It’s also not a matter of the hitbox missing the object because its moving too fast, the hitbox collides with the object without a doubt. I’m not sure why this is happening, as the other attacks involve similar swinging motions, and I could easily fix it by letting my sword script preform the result of a succesful attack from frame 10 to frame 16, But I’m determined to understand why this isnt working.

I also don’t mean for anyone to program my game for me, but I thought there might be a problem immediately obvious to someone else that I wasn’t aware of, or some documentation that might lead me in the right direction. Anyways, thanks for reading all the way to here.

I’ve just determined that the 4 criteria I use to decide whether to preform the result of a succesful attack are all actually active at the same time… but for some reason unity still doesnt preform the correct if statement.

These criteria are (1) a bool called isHitting, which is what the hitbox activates, (2) a bool called canHitAgain, which is used for something else but is active for the entire duration of the attack, (3) if the frame of the attack is after the lower frame limit I imposed (10 frames), and (4) if the frame of the attack is before the upper frame limit I imposed (15 frames). I’ve also determined that if I remove the 4th criteria, it works, which kindof makes sense given that the hitbox detects a collision between frames 14 and 16. It also works if I set the upper frame limit to frame 18.

However, again, ALL of the criteria do become active at the same time, which should activate the if statement but doesnt. It also doesnt explain why the hitbox detects a collision between frames 14 and 16, when it should be detecting a collision sooner, around frame 11 or 12.

Or maybe is it just that unity can’t handle detections this fast? Maybe I’m just expecting too much. I’m probably just being obsessive, so for now I’ll set the upper frame limit to 18.

You know what, I think that’s it. It can’t be anything else, I mean I’ve tested it and this is the only possibility. So i’m going to put this comment up as an answer.

EDIT: Upgraded to unity 5, project settings > time > fixed timescale > 0.01 seemed to fix it. At least for now.

EDIT: just kidding it didnt