camera system for a simple metroidvania

I’m trying to implement a simple camera system in my metroidvania, metroid style, where the camera will sometimes follow the player on the y or x axis, and will flip to other areas, basically there would be 3 types of cameras? I don’t know. The most simplistic way I thought was to create a collision area for each part and place limits on the size of these areas, but I found that it wouldn’t be scalable that way even though the game is small. Another way was to place a trigger in the new area and change the direction but I don’t know how to define the limits, can anyone help me?

right, and how can I attach this to the player and switch with a flip camera?

But then the camera would be controlled by the keyboard and not by the area itself? an example of how I exactly want my camera to behave is the game gato roboto, with the camera following x or y depending on the area, and the camera flipping when changing some of them

Phantom camera is what you’re looking for.

It has a feature that allows you to use collision shapes as camera limit. You can even use Tilemaps as limits if you want.

It really solves a lot of complex camera behaviours that you would otherwise need to code yourself.

For your use case of making the camera follow x or y depending on the area, you may need to use multiple cameras for that.

Thanks, I’ll take a look

1 Like