Jump to content

Phaser Camera Jittering


Jonchun
 Share

Recommended Posts

When using camera.follow, I (seemingly) randomly get camera jitter when moving around. It's weird because sometimes it is perfectly fine, and other times it starts to jitter like crazy (without touching any code. all i do is refresh the page). Any ideas what could possibly be causing this?

 

I've made sure roundPx is true, and tried it with false as well.

 

Edit: Forgot to mention that I'm moving my character around using velocity and arcade physics. I saw a bunch of stuff about how it's bugged buut they were all really old threads with no solutions. 

Link to comment
Share on other sites

When using camera.follow, I (seemingly) randomly get camera jitter when moving around. It's weird because sometimes it is perfectly fine, and other times it starts to jitter like crazy (without touching any code. all i do is refresh the page). Any ideas what could possibly be causing this?

 

I don't have any major suggestions other than to note that I was having similar issues with this recently, except that the sprite was jittering even without camera follow. I spent nearly a week trying to get a single sprite to move smoothly across the screen, until eventually I just gave up and began to work on the rest of the game. Weirdly enough, once I added controls and got some other sprites in there, the jitter seemed like much less of a problem. I don't know if the jitter is actually objectively less, or if I just am noticing it less because other things are going on. I have no idea if you are in a similar situation, but if you are getting the jitter in a very stripped down test, you may want to try living with it and moving on - it might turn out to affect your game less than you think under "real world" conditions.

Link to comment
Share on other sites

I'm getting it on stripped down tests as well. I've been experimenting and I THINK the issue may be a large world size. I tried a stripped down test with different world sizes, (only tested horizontal movement) and every time my world size went over roughly 1500 or so, i started noticing the jitter. It's REALLY bad, and there's no way I can continue if there's no fix for it. I'm going to try out Quintus as well and see if I can get something working.

Link to comment
Share on other sites

  • 6 months later...

Just found the solution to this problem after weeks of hunting for it, just posting it here in case someone else stumbles across this thread like I did.

In your render function if it's not already true set

          game.renderer.renderSession.roundPixels = true;

just once and boom everything fixed.

Ref: https://github.com/photonstorm/phaser/issues/1377

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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