Well I added the script Smooth Follow, my camera to follow my character, because the problem is that there are some movements that I do with my character, the camera passes through leaving the ground to see what is inside. I would like to fix it so that when she turned the camera crash into the ground without the cross and did not cease to focus on character
Thx in Advance
asked Feb 23 '11 at 12:31 PM
One trivial addition to this could be to raycast to the next camera position. If the raycast hit anything, limit the movement to the hit position, and perhaps subtract some length yet to avoid the camera being "exactly on" the ground.
I don't have unity installed at the moment so I can't verify this code would work but basically you'd have two points. One represents the current location and the other represents the next location (that the camera wants to go to);