I just want to know if there is a way to display the parallax between other sprites. My game is basically a fish that eats flies. As such, I need the fish to be displayed behind the parallax so that it looks like its underwater, while the flies are above it. I've tried adding the player to a CanvasLayer and setting its "layer" property to -2, but it causes a weird bug where the Camera2D attached to its center moves along but can't keep up with the fish speed, which wasn't a problem before they were both added as children of the CanvasLayer. I then tried making a custom camera, which was updated each frame by:
func updatecamera():
var canvastransform = getviewport().getcanvastransform()
canvastransform2 = -getparent().position + Globals.screensize/2
getviewport().setcanvastransform(canvastransform)
Very simple stuff. Still the camera starts falling behind the fish, which makes me think the transformations must be also applied to the CanvasLayer or something...
Please help.
Bug explanation, CustomCamera code and Node tree:
Explanation
Code and tree