Camera lerp in mobile causing jitter

  • Hey guys,

    I'm having jitter in my game when testing on mobile. I figured out that the lerp in my camera object (smooth scrolling) is causing this. The movement in my game is very similar to Asteroids (Custom Movement). Here's what I'm using for the camera at the moment:

    Every tick|Camera -> Set position to lerp(Self.X, Player.X, 0.08), lerp(Self.Y, Player.Y, 0.08)

    Is there any way to get a smooth scrolling camera in mobile without jitter/lag?

  • Instead of a fixed value of 0.08, do 4.8*dt which will take into account changes in framerate

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of a fixed value of 0.08, do 4.8*dt which will take into account changes in framerate

    That fixed it, thanks! Tried adding dt in there before but wrote it wrong way in the expression.

  • Hey guys,

    I'm having jitter in my game when testing on mobile. I figured out that the lerp in my camera object (smooth scrolling) is causing this. The movement in my game is very similar to Asteroids (Custom Movement). Here's what I'm using for the camera at the moment:

    Every tick|Camera -> Set position to lerp(Self.X, Player.X, 0.08), lerp(Self.Y, Player.Y, 0.08)

    Is there any way to get a smooth scrolling camera in mobile without jitter/lag?

    Things you should know for mobile smooth performance of lerp and camera:

    1.( Use delta-time for frame dependence like 1.0 * dt)

    2.If it isn't enough then use make it faster especially in older devices. So that the jitter won't be noticed.

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