add camera collision without CharacterController

how to add collision to the camera without the use of character controler?

I made a script for the camera move what I want to happen when is I don’t want the camera pass through any object, I need to prevent the camera passing through walls and gameobjects

is there any posible way to do this without the characterController component? thanks

Try adding a capsule collider to your camera.

The actual result will depend on your moving code, but the collider should prevent it to go through other colliders or rigid bodies.