# Scroll Factor on Camera Stuttering in Chrome

**URL:** <https://phaser.discourse.group/t/scroll-factor-on-camera-stuttering-in-chrome/4592>\
**Category:** Phaser 3\
**Created:** [December 13, 2019, 7:56pm UTC](https://phaser.discourse.group/t/scroll-factor-on-camera-stuttering-in-chrome/4592 "2019-12-13T19:56:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmr](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/cmr/32/2446_2.png) [@cmr](https://phaser.discourse.group/u/cmr)\
**Post date:** [December 13, 2019, 7:56pm UTC](https://phaser.discourse.group/t/scroll-factor-on-camera-stuttering-in-chrome/4592/1 "2019-12-13T19:56:06Z")

</div>

Hi all, here’s my code I run in the `update()` function of my `ScrollableScene` class.

`camera` is a reference to `this.cameras.main` and `scrollFactor` is an integer.

```javascript
if (this.leftMove) {
    this.camera.scrollX += (2 * this.scrollFactor)
 }
else if (this.rightMove)
{
    this.camera.scrollX -= (2 * this.scrollFactor);
}

```

I have two buttons that turn `leftMove` and `rightMove` on and off when we click / stop clicking.

This works pretty well, although I know that there’s probably a better way to set up the code.

I primarily develop in Firefox, so this was working fine, until I tested in Chrome, where (seemingly randomly) the scrolling will completely stutter / be choppy. Can’t really identify what interactions cause it. Anyone deal with something similar / have any tips? First project in Phaser 🙂

EDIT: More information - here’s some code that is run on `create()` that might be relevant (?)

```javascript
this.camera = this.cameras.main;
this.camera.fadeIn(1000);
this.bg = this.add.image(0,0,this.bgKey);
this.bg.setOrigin();
this.bg.setScrollFactor(1);
this.camera.setBounds(0, 0, this.bg.width, this.bg.height);

```
