C3 game file
In my game, enemies move around, advancing 24 pixels up, down, left, or right (all movement and character and level design is regulated to this "grid"). During each move segment, it will move a certain number of 24x24 blocks (Pathfinding is not used). Contained with each enemy are four sprites - I call them "MoveChecks" - that represent one of those four directions. MoveChecks also hold the Line Of Sight behavior with a 1* cone which faces one of the four directions.
I'm using the MoveTo addon behavior, but even when the enemy moves exactly side-by-side to a solid wall object (no overlap), it causes the enemy to stop even though there's no direct collision. So the MoveCheck objects check if they are overlapping a wall and prevent further movement in that direction.
When a MoveCheck catches sight of the main character, Buster, it is supposed to charge ahead in that direction (later I will restrict LOS to only the direction the enemy is facing).
If Buster is more than a single block away and the enemy moves into the same row or column (establishing LOS), then the enemy moves quickly in the direction of Buster.
However, if Buster is exactly one square away to an enemy's corner (ie: top-left) - so, 24-pixels up and 24-pixels left - and the enemy moves up or to the left so to be in direct linear alignment with Buster, the state of the enemy will change to its proper "Attack" state, but won't actually charge in the proper direction until it is one cell father in the direction it was moving when it first caught LOS of Buster.
So if the enemy is moving to the left and is DIRECTLY below Buster, establishing LOS, it will continue to move one more cell to the left THEN dash upwards towards (rather, PAST) Buster.
I have tried adjusting the Pin position of my MoveCheck objects relative to the enemy they're contained with. I've resized them. But this is the one issue I cannot overcome. It works EXCEPT for close proximity. I have a feeling that it has to do with how LOS behavior checks for actual LOS of an object but I'm not sure.
Can someone please examine my event lines and help me identify (or even solve) the problem area?
Thank you so much. (And sorry for the lengthy explanation. I was trying to make the case understandable.)