Day 63 — Changing Camera Angles Using Triggers

Changing the Camera View

public Transform MyCamera;private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
Debug.Log("The player has collided with a trigger");
Camera.main.transform.position = MyCamera.transform.position;
Camera.main.transform.rotation = MyCamera.transform.rotation;
}
}

Follow The Player

public Transform target;void Update()
{
transform.LookAt(target);
}

--

--

--

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Chonkers

Designing Your Code

Weekly Tech Report

ALL YOU NEED TO KNOW ABOUT PYTHON

Eventador Streams Podcast: The Growth & Evolution of Flink with Marton Balassi

Intro to C++: Managing Arrays & Strings

Technical debt. Do I have to pay off all?

.net Calculator with minikube

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

More from Medium

Recap Harder: Oct 2021 Recaps — Part 2

How to Fix Dev Error 5476 in Warzone PS5, PS4, Xbox One, and PC

BBL preview - Sydney Sixers

Millimeter: Glipmse of the Market Status