Changing animation to a sprite changes its position

  • Since it seems like a simple matter I thought it should go to the "Beginner's Questions" section.

    There's a particular sprite in my game that when I change it's appearance, it changes it's position (for no apparent reason). I tried changing it's appearance either with "change frame" or with "change animation", issue occurs with both.

    I can't figure out why it's happening, as when I change the very same object's appearance to something else instead, it doesn't occurs.

    The object is a cage. At first it is locked, and when I change its appearance to "unlocked" all is fine, but when I try to change it's appearance to "Destroyed" (a broken cage), instead of only changing its appearance it also changes its position.

    All three of them have a resolution of 160 x 160, so it's not because the "destroyed" cage source image is smaller than the others... I'm out of ideas.

    CapX: https://www.dropbox.com/s/eh56hhg84rb6qo1/cage_issue.capx?dl=0

    Anyone could please help me with this? I reproduced the issue in that CapX, just have to press the buttons to see the issue.

  • The origin of the destroyed box is in the center, while the origin of the other 2 frames/animations are at the top..

    You can change this in the image editor..

  • Hahahahaha it's just that? lolll Thanks! Can't believe I didn't notice XD

    Thx again! Saved me lots of time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you!

  • Looks like LitteStain found your problem and yes always check your image points in animations or they will jump around like Mexican jumping beans which is not bad if that is the effect you are after lol!

    I usually center my first image point and then right click and click apply to all animations or apply to whole animation and that way they all have the same exact image point.

    You can also do that with added image points and for collision boxes.

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