I am currently working on a project that’s kind of like salt and sanctuary or a game like that if you know what that is. The way I have it set up is that there is a class selection screen and then once the user clicks play the “World” scene is loaded and based on the button the user clicked, a Packed Scene of the character is initialized into the scene.
This has worked so far with minimal errors. I got some animations going and a platform working. My issue comes with the camera. I am using a parallax background with 3 parallax layers. I have attached the camera to each character scene (I have 4 separate scenes, each being a character2d scene) but when I load in, I can see the platform I am standing on but not the background
I have also tried setting the camera on the world scene and dynamically attaching it to the character when it is loaded in but I couldn’t get that to work.
Any information on how to get this to work is greatly appreciated and also if what I am doing with the characters is completely wrong or a horrible way to do it please let me know. This is just the way my mind worked through the problem
Have you tried using the RemoteTransform2D node to make the camera follow the player? And I also wanted to chime in and say that I am doing the same technique for choosing player classes
I just gave the RemoteTransform2D a shot and I am getting the same results unfortunately. I figured it was better to attach screenshots of my setup so maybe people can figure out what’s going on
I figured out the problem. After going into the remote view I realized the camera is offsetting the background by my characters position (the cameras position). I’m not entirely sure how to fix this
This is my remote tree
You can see the position being moved with my character. The x also gets affected I just haven’t moved in the example
You don’t need to place a ParallaxBackground node in a CanvasLayer, because a ParallaxBackgroundis a CanvasLayer, so it will never interact with anything else on other layers except the closest camera. 4.3’s Parallax2D is similar but isn’t a CanvasLayer.
The best advice for parallax effects is to get it working by simplifying, then add complexity. For example, make sure that you’re not accidentally zoomed in with your camera, or your parallax nodes or sprites are scaled. You can find more information on common pitfalls here in the tutorial. It’s for Parallax2D but most of it is relevant for the old parallax nodes too.
I fixed the problem, I don’t know exactly what it was but I deleted the parallax background and all the nodes and replaced them from ground up and it worked. I have a feeling with all my tweaking and messing around I hit a setting somewhere that made it all jumbled. I appreciate all the help guys