2D Sprite Animations As States Overriding Eachother

Alright, so I have a test for 2D sprites in the Game Engine that’s working… Surprisingly well, all things considered. Using logic bricks and states instead of Python to be as modular as possible I’ve gone ahead and put in most of the animations for basic movement. Run, Sprint, Jump, Fall, and Damage. The problem is that because of the way I’ve done it that some of the animations override eachother. For example, when moving the RunRight/RunLeft and SprintRight/SprintLeft animations are occasionally interrupted for a single frame of the InAir animation. InAir is for when the player isn’t touching the floor, and uses an inverted Collision sensor that’s looking for the Ground material to end it. But even when it’s detecting Ground it still wants to play for some reason. Combine that with the problems on taking damage, where when the HitRight state and animation are activated sometimes it’s interrupted by the RunRight, SprintRight, or IdleRight animation for a split second before. I’d like to know how to prevent these little “twitches” from happening. Maybe it’s the pulse setting for the Always sensors, or maybe I have the Delay sensors that switch state taking too long.

Here’s the attached .blend file.

EDIT: I’ve been further trying to fix this problem and found out that it’s not actually InAir, but Idle that’s interrupting all the other states for a single frame. It’s still very random as to when it happens, which is making this more difficult to track down than it really should be.


Bidirectional2DSpriteTest.blend (589 KB)

I’ve fixed the problem. Apparently using a Collision sensor’s not the way to go, as it constantly gives feedback regardless of whether it’s actually being activated or not. I switched to a Radar sensor with pulse triggering and everything’s working out fine now.