I watched a video about scrolling platforms and such by doing this.cameras.main.scrollX. I can’t seem to figure out how to make the camera scroll continuously. If I do something like this:
const cam = this.cameras.main;
const speed = this.scrollSpeed;
this.Player.player.setVelocityX(0);
console.log("here")
this.scrollOffset += speed;
cam.scrollX -= speed;
the camera will not scroll at all if I use use “-=” but if I do:
const cam = this.cameras.main;
const speed = this.scrollSpeed;
this.Player.player.setVelocityX(0);
console.log("here")
this.scrollOffset += speed;
cam.scrollX = speed;
Where cam.scrollX is just “=” to speed, it will scroll just once and not scroll again.
I have verified that this code is being called through the update method so that is not the issue. It just doesn’t make sense how I can use “=” but not “-=” to have it continuously scroll.