How Would I Make a Camera for a Top-Down View for a 2D Gui Game?

What I want to achieve is a camera sorta like system where there’s a player and a map the player can walk around in. I used a scrolling frame to have the map all be loaded at once but I can’t get the camera to follow the player’s position.

I’ve tried to setting the canvas position as the player’s absoluteposition and that just caused it to flicker a lot. I’ve tried setting it to the player’s scale position (it moves with scale not offset) multiplied by the player’s screensize which just made it too fast or just didn’t move at all.

Please do not send me entire scripts or design entire systems for me. Thank you!

2 Likes

Couldn’t you just use use a normal frame that is bigger than the screen of the player instead of using a scrolling frame? You could move the the camera by changing the scale of the position of the frame. You could also use math.clamp to make sure that the camera won’t move if the edge of the world is at the edge of the screen.

2 Likes

That’s a very good idea!
I’ll make sure to try that one out.