How to stop a slow parented camera from going through floor and other obstacles?

i’m trying to get a third person camera going but i’m having problems with the camera going through stuff and the player not seeing anything.
I basically want a camera that will follow the character but at the same time avoid obstacles in the way.

Are there any nice and simple 3rd person scripts that i can just copy and paste into my game or append?
so far not much is working and i’m desperately trying to look for a solution for BGMC11.

Thanks (i’m not very good with python at all)

I’ve made it with rayCastTo and camera animation.
At first i have slow parented Camera to charackter and animated with two keys: default - far from and near - almost over the shoulder.
shoot with rayCast “backward” from charackter to each obstacle with distance calculation. ( See Blender python API.)
If current calc. distance <= distance to camera (getDistanceTo(camera)) just play animation forward.
If current calc. distance > distance to camera play backward.
Carefull with slow parent. There is a bug. May it is fixed allready. You must set position of parent and child to 0 before slow parenting.

Ok sweet thanks guys i’ll give both a try!

Thanks wado i’m not good with python but i just used logic bricks and it worked nicely.
Mobious i really like your demo however i can’t seem to get it to work, i’ve renamed the player according to the python script and tried appending the camera from your demo however its still not working for me. Maybe because its a module?
thanks for the help anyway

You have manually append both the camera and the script. The script doesn’t get automatically appended with the camera because it uses module execution mode.

ohhh right, sweet as, its working brilliantly now!, thanks for the great script! The slow parenting started to glitch out thowing the camera at the other side of the map every second test run :stuck_out_tongue:

Ok huge bug where the camera constantly zooms out without stopping, not quite sure why, moved from layer 6 to layer 1

EDIT fixed the problem just a static and dynamic object colliding
thanks again

If you’re able to reproduce the bug in a simple blend file, I’ll take a look at it.