How can I build better collisions with these animations?

  • Hi guys & gals,

    I'm new to the construct platform - it seems quite exciting and I'm getting a hand for some of the basic mechanics.

    I tried the platform behavior on my sprite (which has multiple animations.. Idle, Run, Jump, Fall). The problem I am facing is the size of each animation is a little different which caused issues (For example. Character partially jumping through a solid however the landing animation catching on the edge where there isn't any contact).

    I tried to remedy this by creating a 'collisionbox' for the player which I've matched the position to. This has fixed some of the animations however this way applies the same size box to all animations. It's a bit hard to describe.

    A few pictures have been added to hopefully show what I mean - the collision box is shaped and sized properly for the 'fall' animation however when it flips back to idle the collision box is too bix for that animation.

    [img= [img=

    ]

    ]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • have your character with the behaviors be a square and pin the ninja image and it's animations to it

  • drive.google.com/file/d/1bajYeBYiOWSC9PJ6nJyy3n2tX9c2GGfO/view

    This is my example. I believe I've mostly done what you've mentioned but the problem is as you will see.. The width of one animation is different than another.

    Do I need to make multiple collision boxes to cover each animation and disable/enable the boxes or is there an easier way?

  • What you have there is all you need. The idea is that you have one object to handle the collisions and the animations do their own thing. You only need to detect player collision with the one box object. In 2D side scrollers you are not checking collision right down to the shape of the body of the character however if you are using a melee weapon for example you could spawn this with its own collision to detect an attack.

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