How do I stop my sprite jerking around every 3 frames...?

0 favourites
  • 11 posts
From the Asset Store
three fully animated characters ideal for your RPG side scroller projects
  • So basically, my sprite was fine - now I've replaced it with a new sprite, every loop, half way through, my sprite shoots through the floor and then back up again?

    I'm not sure why.

    Could it be something to do with the fact that the 3rd frame is slightly shorter in height?

  • Could it be something to do with the fact that the 3rd frame is slightly shorter in height?

    Definitely. You can do 2 things:

    1. Make all frames the same size.

    2. Change the anchor point so the sprite does not "move".

    Hope this helps. Cheers!

  • Hmm, even making each frame the same size, still doesn't fix it :/

    I can't use an anchor, because the sprite is my character - it needs to move

  • I meant the "Origin" image point, it's like a target icon on the sprite editor. Could you share the capx?

  • If you follow the recommended method of using an invisible sprite with no animations as the collision and movement sprite, then pin the animation sprite to this, you would likely not have such problems.

  • If you follow the recommended method of using an invisible sprite with no animations as the collision and movement sprite, then pin the animation sprite to this, you would likely not have such problems.

    I see - do you have a link to a tutorial?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you follow the recommended method of using an invisible sprite with no animations as the collision and movement sprite, then pin the animation sprite to this, you would likely not have such problems.

    Hi zenox98!

    I understand this is the recommended method and, in fact, I normally use it, but now you got me curious... How would having the animations and the behavior on the same sprite affect the animation flow? Is there any known issue there of which I'm unaware?

    Thanks in advance.

    Cheers!

  • brunopalermo I think the main benefit of this method is that you can define different collision polygons for different frames/animations on the character, for better interaction with other objects. (Say, extended arm with a sword in "Attack" animation will damage enemies etc.)

    If you have Platform behavior on the same sprite, then constantly changing collision polygons can mess with Platform movements. For example, that extended arm with the sword will push the character away from walls. Or character can collide with the floor on some frames and "jump" for a few pixels, or lose connection with the floor and switch to "falling" state for a brief moment.

    If you have events like "If Platform is falling, Set animation to Falling", the character will switch from one animation to another very quickly.

    You probably know all this already, in this case I was explaining it to ssaamonn

    Simply create a rectangular sprite the same size as your character, make it invisible.

    Add Pin behavior to your character, on start of layout pin it to that sprite.

    Remove Platform behavior from your character and add it to that invisible sprite.

  • Simply create a rectangular sprite the same size as your character, make it invisible.

    Add Pin behavior to your character, on start of layout pin it to that sprite.

    Remove Platform behavior from your character and add it to that invisible sprite.

    As recommended in Ashley's top https://www.scirra.com/tutorials/253/how-to-make-a-platform-gamer tutorial (discussed on page 4).

  • > Simply create a rectangular sprite the same size as your character, make it invisible.

    > Add Pin behavior to your character, on start of layout pin it to that sprite.

    > Remove Platform behavior from your character and add it to that invisible sprite.

    >

    As recommended in Ashley's top https://www.scirra.com/tutorials/253/how-to-make-a-platform-gamer tutorial (discussed on page 4).

    Thanks for that - the explanation makes a lot more sense. The only problem I'm having now is that I can't seem to line up the box to the sprite animation - so the character won't stand directly on the solid floor? Really strange.

  • Hey dop2000!

    Thanks for the detailed explanation. I'm not a programmer so, sometimes basic concepts may elude me. This was one of those things I always did, because it was recommended, but never quite understood why.

    Cheers!

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