camera collision

i have a third person camera, the camera orbits around the character in relation to the mouse

but the camera goes through walls

now my question is, how do i make this camera collidable so that it does not go through the walls?

so far i understand that attatching a collision sphere to the camera and making it collidable is part of the steps…but other than that i am clueless

Frist off, your map has to be collidable using the collision tags {Polygon descend keep}.

If you have done this step, then go on adding your collision to the camera using this code.

#Setup collision manager
base.cTrav = CollisionTraverser()
#Pushes objects back
base.pusher = CollisionHandlerPusher

#Add a collision sphere node around our camera.
self.cnodePath ='CollisionSphere'))

#Setup the collision sphere.
self.csphere = CollisionSphere(0, 0, 0, 4)#May need to change this number as you need.

#Add our collision node to the puser and then to the collision manager

Make sure you check out astelix examples on collision. They are very detailed and work step by step.