How do I stop my character's jittering? (lerp camera)

0 favourites
  • 15 posts
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • I use a lerp camera that smoothly follows the player. Whenever I stop moving while the camera is still moving, my player jitters for a bit until the camera stops moving. Any help would be greatly appreciated.

    dforms.ca/c3/demo.c3p

    Thank you for your time.

  • Your formula for lerp is a bit weird, you can change it to lerp(Self.X, Player.X + 2, dt) , it will work the same.

    As for the jittering, try adding "Player set x to round(self.x)" to event #4 "On stopped". I think it reduces the jittering.

  • Thank you for your suggestion Dop. I gave it a try and unfortunately it didn't prevent the jittering.

    Updated c3p: dforms.ca/c3/demo_v2.c3p

    I spent a lot of time looking for a solution and nothing worked out.

  • Well, I decided to scrap the lerp camera in my project for now. It's unfortunate because I really liked the effect it had. After reading on the subject, I have come to the understanding that Construct 3 isn't fully capable of supporting a lerping camera without causing variant degree of jittering (for platform games); At least not easily... I guess there's always a way, especially since you can add your own JavaScript to your projects etc. But, I wasn't successful in trying. Eventually, if I get it to work, I'll post the solution here.

  • Normally there is no problem using Lerp on the Camera but it looks like the problem is that your using "Letterbox Integer Scale" if you change the Full-Screen mode to "Scale Inner" it doesn't do that flickering on the Player but again the whole Background Graphics doesn't look that smooth, not sure what could be the solution.

  • Hi Tarek, thank you for the info. I'll look more into fullscreen modes. I'm new to Construct so I left it on the default. Changing the mode to Scale Inner does reduce the flickering on the player, but like you say it is transferred to the background. Maybe resizing the layout to fit the background exactly may help. I will try that next. What are the modes you use most often when building your projects?

  • Hi Tarek, thank you for the info. I'll look more into fullscreen modes. I'm new to Construct so I left it on the default. Changing the mode to Scale Inner does reduce the flickering on the player, but like you say it is transferred to the background. Maybe resizing the layout to fit the background exactly may help. I will try that next. What are the modes you use most often when building your projects?

    Hi DFORMS

    I use Scale outer or Inner for mobile Apps but this is for normal Games and for pixel art like you have I'm not sure what they use exactly I know they use different Mode and few more tweaks but I can't remember which one they use as I never did anything with pixel art, maybe someone that has more experience with pixel art and sees this post can give you the right Settings I definitely have no clue sorry for that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think if you add some parallax to the background, the jittering will be less noticeable.

  • I'll give that a try tomorrow. But, if that's the solution it's going to require rethinking the setup of my entire project. Thanks for your help guys.

  • Turn on pixel rounding in project properties.

  • Yea, I know about the pixel rounding. The issue with that is the player sprite starts flickering when moving while at the edge of the camera. I noticed a few little additional positioning issues when the pixel rounding is on. I think it's best to leave it turned off. Unless there's a fix for the player flickering. Thank you for your suggestion.

  • Diffidently the best version as of now. The player is still jittering, but it it's greatly reduced. I'll study your setup today. Thank you for your help Dop. I'll report back after running some additional tests.

  • Also kinda unrelated, but usually wouldn't you want the camera to lead in front of the player rather than follow behind them in this type of game?

  • Yes, that's exactly what I did today. Especially since I have the UI on the right side of the viewport. Unfortunately, now I am unable to open my project... I get a Construct 3 failed to open project error message. I created a thread regarding this here. I hope I'll be able to recover my project. If not, I'll be pretty bummed out. Thank you for all your replies guys. Great community so far!

    Edit 1:

    I fixed the issue.

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