I think the best way is to set a point in your scene called ancher, which does not move on your screen, but calculates every other position relative to it. The archer moves along each other player, but is controlled (for example, you can set it in the middle of your track together with the player), in this case you only need to move the background according to your character, and then you calculate other positions relative to the anchor. it may look a little more complicated, but implementing it is much simpler and more complicated than any other method.
source
share