Point and Click Movement Part 2

Objective: Changing Camera Angle as Player Moves through the Scene.

The first thing that I will do is create empty Gameobjects throughout the Scene. Then add components; box collider and a ridgidbody.

Make sure to check isTrigger and turn off gravity.

Now that the Triggers are set it’s time to create the code for setting the Camera angles. I will first create a script CamerTrigger and assign it to each Trigger GameObjects.

In the script, I will first need to get a reference to the Transform of the Camera Angles.

I have the SerializeField attribute so a can assign each Transform in the Inspector.

All that’s left is to check for a collision and set the Camera to the new Position and Rotation.

Let’s see this in action.

Happy Coding!!!




Unity / C# Game developer

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

Recommended from Medium

AWK Scripting Language

Scope in JavaScript

JS WTF 🦄 with Arrays

3 FAST useful tips for Java Developers (pt1)

useResponsive: Writing Your Own React Hook for Handling Responsive Display Sizes

Manage your observable subscriptions in Angular with help of rx.js

Web based IDE with React & Microsoft Monaco Editor

PHP learning

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
Bill Rislov

Bill Rislov

Unity / C# Game developer

More from Medium

Day 112: Animated Tile Maps

Scripting Actions (New Unity Input System)

Pushing Objects in Unity

Camera Look System in Unity!