Im trying to make an infinite world generation with different layers of parallax backgrounds to make it feel more alive. But whenever i try instancing a child inside of a parallax background, they dont exactly end up in the same spot, rather than the first 3 tries which run when the games opened for the first time. Instead, they seem to skip a few tiles and this amount seems to be fixed for all layers. This works if i dont instance the children inside of a parallax background and anywhere else, but im unsure if theres a way to achieve the same effect without using them.
for layer in 3:
var background = load("res://world/plates/backgrounds/full/Background" + str(layer + 1) + "Full.tscn")
var bg_instance = background.instance()
get_parent().get_node("ParallaxBackground/ParallaxLayer" + str(layer + 1)).add_child(bg_instance)
bg_instance.global_position.x = gvar.step * plate_margin
For context only the "scale" variable is different on each 3, being 1, 0.5 and 0.75 respectively. Again it works if i put them anywhere else, and it even seems to return to the right position when i print its global position out, but how do i fix this "visual" issue?