Changing camera by collide a mesh

Hello guys,

I would like to make a script that changes the camera number when colliding an invisible box. I’ve a static cam with a ‘Smooth Look At’ script that follows the character from a room top. But when walking through a garden the camera should change from the top cam to a 3rd person cam and when walking even further it should change to another static cam in the garden. All the changes should happen when colliding with a transparant box or plane. Should be something like this:

  • character walks, viewed by cam 1
  • character walks through collider,
  • if cam1, use cam2
  • if cam2, use cam1
  • camera changes,
  • character walks on viewed by other camera than started

I am kinda noob in Unity and C# but how to do this?

Thanks!
Robin

Welcome to the forum, Robin!

It looks like what you need here is a BoxCollider configured as a trigger (see the manual page to see how this is done).