I am moving my camera by changing its position field according to the input. The problem is that whenever the camera crosses one of its limits, it still moves, even when the viewport doesn’t. That makes it so that when I try to cross back into the main scene it takes a while.
Is there a way to force the camera to now wander of boundaries, or maybe a better way to move it?
The best way is to probably clamp it’s x and y to the desired boundaries. If the boundaries are dynamic, you could get them from the size of your area.