Family Animation change causing Family's Instance to fall through JumpThru Platforms

0 favourites
  • 3 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Having a bit of a strange issue. The second I change any instance of my Enemy Family's State to Attack, which also sets the Animation to be the one named Attack. They fall through all JumpThru Platforms while it's playing the animation, but not Solid Platforms.

    I've tested it out with other States and their corresponding Animations for the other Enemy States that are possible. It happens with them all. Doesn't matter if they are changing over to Attack, Death, or TakingDamage. They fall through the JumpThru's and land on top of the Solid Platform at the bottom of the layout.

    It was working fine in the original project, which was setting up the actions for each enemy, rather than working with them all as a Family Object. Turning it into a huge Event Sheet. I've double checked their collision boxes and Origin Points are staying to where they were set before moving them into a Family with a State Machine.

    If anyone has encountered this before, or has any ideas off the top of their head. I'd appreciate anything helpful. If you took the time to read this. Thank You :)

    EDIT: For the time being, I'm setting the Enemy Family member's Gravity value to 0. Then just switch them back to their Walking State, once they lose their Line of Sight. But, I'm sure there is a better way to do this? Or some other reason for the strangeness?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The reason is likely a different collision polygon or origin point position in the "attack" animation. When animation is changed, the polygon appears slightly overlapping the JumpThru platform, and the enemy falls through it.

    The solution is to make sure all origin points and polygons are the same in all animations. Or use an invisible base sprite with platform behavior, and pin the enemy sprite with animations to it.

  • The reason is likely a different collision polygon or origin point position in the "attack" animation. When animation is changed, the polygon appears slightly overlapping the JumpThru platform, and the enemy falls through it.

    The solution is to make sure all origin points and polygons are the same in all animations. Or use an invisible base sprite with platform behavior, and pin the enemy sprite with animations to it.

    I triple checked this, but I think you are absolutely right. I'll definitely look it over again tomorrow. It was working fine before, but I was also playing the animation directly, and not using the Family Object. So now it's checking the instance of the family, and changing a state variable, which then plays the animation associated with it. Which is essentially doing the same thing but in a very different way.

    I could definitely do a square or rectangle base sprite like I do for the Player, and disable collisions on the animated sprites. I was thinking about doing just that originally, but for some reason decided against it. I think I'll go that route honestly, as it will be far faster than looking over all the frames of every animation of every enemy. I cropped all the animation frames, so there definitely is variance even when applying point/box to all the frames.. The Origin Point or Collision Box must be jumping just enough to put it in the platforms.

    Thank You so much for your response. It really got me on track, and it's going to save a ton of time. Enjoy your Friday/Weekend :)

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