Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Camera Follow Jitter


RestingCoder
 Share

Recommended Posts

I am having an issue with the entire world jittering when the camera is moving to follow the player sprite. I have found that this only occurs when I use sprite.body.velocity.x or any other velocity based movement. If I use something like sprite.x -= 4 it does not occur. Have I missed something?

 

If you'd like to see an example, please let me know. I'd prefer this project not be entirely public, as it is personal.

Link to comment
Share on other sites

Ah cool, I had this problem a couple days ago and figured out a roundabout solution after a while by making the controlled sprite be invisible and have the player sprite follow it but with rounded values like so:

player.x = playerLoc.x;player.y = playerLoc.y;player.x = Math.floor(player.x);player.y = Math.floor(player.y);

Glad it'll be fixed though so I can get rid of that ugliness.  :P

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...