How do I clamp my 3D camera to specific points

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

Hi so I was following this tutorial by BornCG for how to make a simple dodge and collect 3D game. I was also doing a bit of freestylin’ so I changed the visuals a bit to fit my liking. I say this because I wanted to figure out how to make the camera stop moving at certain points. When you reach any corners, left, right and bottom you would see this empty space and I personally don’t want that, but I also want my camera to follow the player

If you fellas could help me out, I’d be happy

:bust_in_silhouette: Reply From: spaceyjase

Use a springarm: https://docs.godotengine.org/en/stable/classes/class_springarm.html

The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment.

Using colliders to control where the camera adjusts its view (based on the springarm movement).

You could also clamp the camera position too.

Well, I tried to attach a collission object and shape to my camera to see if it could collide with other objects but it doesn’t work. And I’m not very good with GDScript, I’m pretty much a beginner so I wouldn’t know how clamping the camera works unless I follow a step by step guide

OmarBeltran | 2023-01-24 15:21