Camera help?

so i wanna know if there is a way to not make my camera go past a certain point, because right now it just centers the player the whole time. (basically i want a ceiling for the camera)

2 Likes

@richard

1 Like

This can be done easily with tilemaps, since the camera refuses to look beyond the tilemap, you could also add invisible sprites to makes the camera stop following you when you overlap with them

You could do something like

On game update:

Camera x = player x

Camera y = max(player y, celing)

1 Like

i don’t want to make it like that tho because one, i have code for something above it and that would make the camera stop tracking left and right movement.

You can make an invisible camera sprite and when the X of the camera sprite is on the X level of what you want to stop at. make it so that the VX and VY of the camera sprite is 0

You could use math constrain I’ll make a demo when I get home

2 Likes

demo

3 Likes