Posts Tagged follow

Unity terrain avoiding smart follow camera



Download

I’ve been needing a terrain avoiding follow camera, I couldn’t find one that was exactly right so I produced my own.

My script uses multiple different methods to keep the followed object in view:

* Desired location with the camera adjusted for terrain height

* Rise above structures

* Zoom in to be closer to the followed object

* Camera rotation (cut view) to a different angle

Each method can be weighted to give the effect that you prefer.  Each method votes on how aggressive a movement it had to make in order to locate the camera in an unobstructed location, the winner gets to set the location of the camera.

You can download it here.

Here is it in operation – I’m moving the camera a bit to put it in difficult places, but mostly it’s under the control of the system.

, , ,

2 Comments