I have added camera shake to a 2D scene that is static (camera does not follow the player). The scene has multiple CanvasLayers and ParallaxBackgrounds and looks like this:
(Node2D) Level
- (CanvasLayer) Background (Layer 0)
- ParallaxBackground (Layer 0)
- ParallaxBackground (Layer 0)
- ParallaxBackground (Layer 1)
- (CanvasLayer) Foreground (Layer 2)
- (CanvasLayer) UI (Layer 3)
- (Camera2D) Camera (Z Index 0, Z As Relative on)
The issue is that the camera shake only affects the ParallaxBackgrounds. What I want the camera shake to affect is only the Foreground layer and its nodes.
I have tried making the Foreground a child of the camera, hoping that would limit the camera shake to those nodes, but no matter where I place the camera in the scene the shake is only applied to the ParallaxBackgrounds. I've also tried different Layer and Z Index property combinations with the camera, but haven't been able to limit the camera shake.
Why is camera shake only being applied to the ParallaxBackground layers?