How can I put camera borders and remove them later. Also what is a dublcate and why is this site givving me that error

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MemokingMH

I want to add camera borders for my game but I don’t know how to do or is it possible to do. I think I can make it work using 'if’s and checking camera position but it would be too long

Oh, do you mean like a ‘recording screen’ where the camera has the red recording dot and battery percentage?

Snail0259 | 2021-07-10 00:41

Sometimes it may take a few hours for a person who knows about the subject and can comprehend your question to give you a good answer, when you repost the question it won’t necessarily be answered faster but it will push other questions down which is why the site gives you that warning.

Yuminous | 2021-07-10 02:47

:bust_in_silhouette: Reply From: Speedsta

you could add mathemathical “clamp” for the camera the camera position or you could add an collider to the camera/or the player and make a wall arround the level.

Look here:

:bust_in_silhouette: Reply From: Speedsta

global_position.x = clamp(global_position.x, MIN_X, MAX_X)
global_position.y = clamp(global_position.y, MIN_Y, MAX_Y)

:bust_in_silhouette: Reply From: Snail0259

you have accidentally posted the question twice, so maybe delete (or hide) the old one, and that’s why it was giving you a ‘duplicate error’

as for the ‘camera border’, you can put an image in the 2d screen (as a sprite or something), and it will be displayed on top of the 3d scene.