I am making a 2d infinite runner game, and was wondering whats the best way to prevent camera from going outside my background
I essentially want to clamp it, so it doesn’t ever show below a Y value.
For simplicity, I am just using a basic Character Controller, that has a CameraBoom(Spring arm) which has a child Camera component
I was thinking of just doing a
onTick, clamp y value of boom to be yMin
I was wondering if there was a non ‘onTick’ approach for this?, that just simply prevented it from going too far down, e.g. never go negative y value, or go above y value.
Specifically so that if you are near the bounds, the player will physically appear closer to the edge, but rest of time they will be centered. (think Mario)