Parallax layer affects player's sprite

Godot Version

4.2.1

Question

Hi guys,
I followed multiple tutorials on parallax background for 2D and I am facing a strange problem. When I use parallax background, the position of my player’s sprite is somehow affected ( see screenshot below ).

I created a simple scene with parallax background and another subscene containing a CharacterBody2D with a Sprite2D and Camera. If I add a collisionBody, you can see that the collision body is always at the center of the screen (correct) but the sprite is rendered outside of the player position (incorrect)

I made several test project but it always ends like this :frowning: Can you give a hint what am I doing wrong?

Thanks

If I move my player from left to right, the player’s sprite moves from left side of the screen to right side. The collisionShape renders where It should, the center of the screen

It will be helpful to see a screenshot of your scene setup.

Hi,
here are the screenshots:

here you can find the project archive:
https://file.io/xLk5bGGSGI1j

Hi,
I did not solve the problem but I found out that when I copy the project to another laptop, it works there without any issues.

My non working environment is windows 7 with intel UHD Graphics 620

That’s weird. I can’t find any problems in your scene tree. Some options you can explore:

  • try making the characterbody (player) the child of the Node2d instead of the parallax background. I highly doubt this is causing it but it’s worth a try.

  • Make sure the players sprite2d is not set as top level. When a node is set as top level, it doesn’t take the position of it’s parent.

Hi,
it is definitely not a problem in the scene AFAIK. Additionality, when I change the render mode to compatibility, it works.

If anyone wants to have a look, please let me know. I will probably switch to another laptop for now
Thanks

Same problem here, The problem happens exactly when I change the “mirroring” function of the parallaxlayer, the distance at which the player’s sprite moves away from the starting point seems to have the same value added to “mirroring” regardless of whether it is done by the code or by the interface