Platform behavior and animations - how to get it working?

  • Hello all,

    I have a sprite with a Platform behavior on it, and a sprite animation of "walking".

    I've noticed that the collision between the sprite and solids are with their collision polygons, but adding "Bound to layout" is calculated by their bounding boxes, and not by their collision polygons...

    So the way I see it, I have 2 options:

    1. Make sure all frames are at the same width and height, so collisions between other elements are uniform. This makes animations very limited (can't exceed the width of the frame).

    2. Remove Bound to layout and put invisible solid walls at the edges.

    In any case, this requires me to edit each and every frame's collision polygon so the collisions are perfectly executed.

    Is there another more friendly way of handling this?

    Thanks!

  • Use an invisible sprite that acts as collision and controller. Set the position of the animated sprite to it.

    Something like this.

    System every tick (I usually an empty condition since it will calculate it every tick anwyays) --> Set AnimSprite to PlayerController (image point 0)

    Don't forget to set:

    PlayerController is mirrored --> Set AnimSprite mirrored

    same for not mirrored

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks FraktalZero, looks like it's working quite well, although i have tested everything

  • trueicecold, cool I'm glad

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