Camera Collisions

Hey guys, i need help with something in panda, i want to make camera collisions bc the camera colliding with the walls on my world, anyone can help me?

I take it that you simply want to keep the camera out of the walls of your environment?

If so, I suggest simply attaching a new NodePath to your camera and adding to that a CollisionSphere (perhaps with whatever bitmasks may be relevant in your case), then adding that to a CollisionHandlerPusher (taking the camera’s NodePath as the one to move) and the appropriate CollisionTraverser (likely base.cTrav).

In short, treat the camera like any other object that you want to prevent from passing through walls.

(You may find it useful to tweak the radius of your CollisionSphere in order to adjust the minimum distance from camera to wall, and may want to adjust the camera’s near-distance to prevent walls from disappearing when viewed at close range, if applicable.)