Focus Vcam On Trigger

I have a virtual camera that activates when player collides with objects that has “house” tag and deactivates when OnTriggerExit. My problem is, i want this camera to automatically look at the collided object. Since its not a single object but a number of objects that has same tag, i don’t know how to make vcam look at that one specific object when collided.

Here is what you want.

You’ll need to have a script which uses Transform.LookAt
Here: Unity - Scripting API: Transform.LookAt

This script should be on the Vcam.

(target) in the script needs to be the transform of your collided object.

Try it out and let us know if it succeeds. The demo script is rather helpful.

Keep on creating!