My Mario is teleporting

When you press J & L for some reason Mario keeps on teleporting

1 Like

Works fine for me?

@Milo I think your animations are the culprit:

Because you have animations that change size each frame, you might want to try creating a hidden “body sprite” that you use for all of your physics and a second “display sprite” that just animates.

Here’s some example code demonstrating what I mean:

The sprite on the left is actually two sprites; one is running an animation that changes size each frame and the other doesn’t animate at all. We do all of the physics/controls/overlaps etc. on the sprite that doesn’t change while the animating sprite is just placed on top of the non-animating one each frame.

The buggy sprite on the right uses one sprite for both animations and physics and it jitters/teleports whenever the current frame in the animation changes size

2 Likes