Hi, in my recent side scroller game, i have 2 solutions
- Detach Main Camera at the moment of player die, simple if you don’t need complication.
- I don’t add any camera on actor, i’m making 1 Actor with camera and spring arm attach to it, and this Actor will follow Main Character location, this way i can add extra code to clamp Z value in my desire. So when fall through hole or jump too high the camera won’t expose what we don’t want player to see. You can even add some box trigger to modify that limit for each area.
In case of my project, each area have its own camera and trigger to handle camera limitation. I use SetViewTargetWithBlend to handle transition.