Enemy character movement SLOW and JITTERY

Hey guys,

I have an enemy character who's movement is really slow/stuttering ever since I added a condition involving a certain type of floor, explained here:

So I am creating some AI for an enemy character for a platformer. In the scene, there are two sets of platforms or floors, one is high and it drops down onto the ground floor, 1 Player character with platformer controls, and 1 Enemy. Enemy is on the Top Floor, Player is on Bottom Floor.

So, I have the enemy Moving right only while overlapping/colliding with the Top Floor, while playing a run animation. He then falls down to the Bottom Floor. While falling, he plays an Idle animation again. Once he hits the Bottom Floor, he starts chasing the player within 500 and -500 pixels, while playing a run animation. Meanwhile he is setup to play an Idle animation when Y does not = 0, and when X = 0, so basically while standing still or falling. This setup works well IF the player character is not moving. If you start to move the player character, and then stop moving the player character, the Enemy movement starts to slow down and become really stuttering, sometimes flashing between the Idle animation and the run animation briefly. This only happens when the Enemy is on the Bottom Floor. Why is the Player movement effecting the Enemy run speed and animations?? It is worth noting that this started once I added the colliding/overlapping with Bottom Floor condition to his Chasing behavior.. it works fine without it but then there are other problems, so I need the chase to be specifically on the Bottom Floor. The Chasing behavior works by switching a Boolean Attribute ON when player is with 500 and -500, then Moves to the enemy. Something with this collision/overlapping with Bottom Floor is causing the issue. Also, the animations for the Enemy and Player are the same, and some of them are named the same, I just changed the color for the enemy, dont know if that is a problem...

Sorry this is so long, if it is unclear I can explain more. Thanks guys.

Comments

Sign In or Register to comment.