How to keep UI objects on screen?
When a camera position is changed to follow character movements. Every other object in the same layer appears to move on the screen. This is what is expected for backgrounds but UI (User Interface) objects like life bars and menus must stay in place.
To avoid UI objects to leave the screen, they must be moved in their own layer.