How to create a professional 2d camera in godot 4.2?

Godot Version



During a week i’ve searched across the internet a way to implement a 2d camera that has the same behaviour that the one we can find in Super Mario World.
But it seems that nobody did that. Can you help me implementing this kind of cameras for my ongoing game ?
Link to reference : Super Mario World camera
Thanks !

You need to look at two main parts of the Camera:

Limits - This tells the user where the camera should not go past. For example, in the start of that SMW level, the camera does not go past the level on the left, which is why Mario appears at the left for only that part.

Drags - These set the “dead area” in the middle of the screen, where if the player moves into these, the camera won’t change. In the first SMW level example, the “dead area” is to the left of the screen when the player is moving right, and vice versa. You would need some script that changes this depending on which way the player is moving.

Sorry I can’t help more, but hopefully this gives you an idea of where to start.

It may also help to check the phantomcamera addon -


Thanks !