Hello here is my problem of the day, I have an element on my background which must be in collision with my ship but as there is a parallax effect in my game and the object to touch must follow the background then the collision does not is not done or else is done very to the left of my object. A solution for me please? THANKS.
You need to provide a bit more information. Are you scrolling both the background and the layer the ship is on? I’m making the assumption you want the ship to be in collision with the water, but it’s not clear form you initial post.
If you want an object on one layer to visually collide with objects on another layer, then the two layers need to be scrolling at the same rate and same directions.
the background with the water scrolls from top to bottom at player*0.3 camera speed, the ship must not touch the water but the star in short the ship will rescue the star which is on the small island . And so even when the ship finds itself superimposed on the star, the collision does not take place, or rather it takes place, but then very to the left of the star.
in the first video the star is where it should be and follows the background perfectly but as a result there is no collision. In the second video I just moved the star to the center of the screen to show you that the collision occurs very to the left and far from the star (the collision boxes are well adjusted).
Ok, after 4 days of racking my brains, I finally found a less simple but working solution. Instead of making the BG layer camera move, I make all objects on BG move inversely on the X axis relative to the player ship. This gives a little more line but too bad, just as the placement of the stars is also different for each instance and is controlled by different variables for each instance. In short, I will be able to move on.