# Camera lerp in mobile causing jitter

Get help using Construct 2

### » Sun Jan 31, 2016 4:27 pm

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?
B
12
S
4
G
1
Posts: 69
Reputation: 987

### » Sun Jan 31, 2016 5:09 pm

Instead of a fixed value of 0.08, do 4.8*dt which will take into account changes in framerate
Find all the Construct 2 games that were on Steam Greenlight here
B
42
S
11
G
7
Posts: 513
Reputation: 7,355

### » Sun Jan 31, 2016 5:46 pm

OddConfection wrote: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.
B
12
S
4
G
1
Posts: 69
Reputation: 987

### » Sun Jan 31, 2016 5:51 pm

VValt wrote: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.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
83
S
31
G
94
Posts: 1,166
Reputation: 63,468