Scene - I have background clouds that are on another layer. A negative force is automatically applied to the clouds once they spawn.
Problem - When my character moves to the left (horizontal speed < 0), the clouds move faster and when my character moves to the right(horizontal speed > 0), the clouds moves way slower.
Extra discussion - The code is really simple, so I think this will be clear to understand without a picture? I’m not sure if my head is just foggy at the moment but I cant seem to figure out a solution. What’re your thoughts on this?
Hey good morning,
This code displays the background layer movements. The cloud layer isn’t one of the “parallax layers” so they don’t move according to the player.
I can’t see why from the events, so my guess is that it’s an optical illusion, and the clouds maintain their speed, but they appear to move faster because of the movements of the other objects. To counter this effect, I’d suggest you either:
Apply parallax scrolling on the “Clouds - Background” layer, or
Apply less force to the clouds when the player is moving in the same direction as the clouds, and more force then the player is moving in the opposite direction to the clouds.