How to make a metroidvania map system

Godot Version

4.3

Question :exclamation:

i want to learn how to make a classic camera system for metroidvanias in godot.i dont want the camera to always follow the player soooo.if the player is at the end of the room, the camera will be static, if the player is in the middle of the room.i will follow the player.i also want it to work up and down.if you didn’t understood this is what i want to make, here is an example of the thing i want:

btw, im trying to make this with one tilemap node

if you know the answer pls reply, i will really appreciate it

Hello there, @Neonsise! You can use the “Limit” properties of your Camera2D node to control your camera’s movement. You can set your left, top, right and bottom boundaries for your camera in each room.

imagen

I hope this helps you!

yeah but i want the limit to change on each room like in the video.at the end of the room the camera turns static and when you enter the room, trhe same thing must happen but with the limit setting that you said.it will not work, because the rooms dont have the same size

The behaviour seen in the video can be replicated creating an Area2D in each room exit. These Area2D will emit the signal “body_entered” when the player exits the current room and enters the next one. You can connect a function to update the camera’s limits to this signal, so each time the player goes to another room the camera’s limits will be updated.

its possible but can cause lag

Just curious, why could it casue lag?

There’s also an addon called PhatomCamera2D. You could take a look into its documentation to see if it suits you.

it can cause lag because then godot has to read script by script and the things get repeated a lot wich can cause lag with a lot of rooms

i will try the addon,THX