Collision doesn't always work

0 favourites
  • 4 posts
From the Asset Store
This Girls Game allows young fashionistas to develop their taste and skills as a fashion designer.
  • I'm very new to programming in general but very familiar with graphics (my living for decades). Anyway, I'm just going through tutorials and playing with the behaviors. I'm following the tutorial for a platformer but the collision doesn't always work. I'm trying to figure out why my enemies sometimes hit the EDGE marker and turn around and other times they do not. I tried putting two edge markers down in one location which helps but they eventually go through. Any help would be appreciated.

    Link to project:!An5w1gaZF1_si3gDf6_Su8n_8Pgl

  • Collision polygons and origin image points are very important in Platform behavior. Your enemy sprite has different collision polygons in different frames. So when animation is playing or when the sprite is mirrored, it may suddenly overlap solid objects, which can cause different problems.

    Make sure collision polygons are symmetrical and origin point is in the middle of the sprite (horizontally). Another very common solution is to use a separate invisible rectangular sprite with Platform behavior, and pin your character sprite to it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • To fix this, open the enemy sprite and player sprite, switch to the collision polgon, and pick an animation frame that has a full rectangle collision polygon.

    Right-mouse click the view, and choose "Apply to whole animation". Do this for both sprites.


  • Thank you both so much! Changing the collision polygon worked perfectly! Solved.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)