- Home /
Parallax background choppy movement
I'm moving my background objects according to the camera moves. When the camera moves quickly we can notice some jump/lag in the background. Notice that any other element in the scene is ok (elements such as the player or the ground). Only the object following the camera is having glitches.
I guess it is a sync issue. The camera position is updated in OnPreRender(), the player, background and other things are updated in Update() .
Maybe the following is happening :
Background Update() ==> Moves the backgrounds objects accordingly to the camera position
Player Update() ==> Moves the player
camera OnPreRender() ==> Moves the camera to follow the player.
That would cause the background to not be in sync with the camera for that particular frame. It would catch up next frame causing a jump. Do you have any solution for this.
I tried updating the background position directly from the OnPreRender() function, without getting better results.
Your answer