Handle Camera Targeting Based on Control Scheme Changes Like a COMMERCIAL GAME | Unity Tutorial

Subscribers:
59,700
Published on ● Video Link: https://www.youtube.com/watch?v=y0ud-aygcic



Duration: 14:08
2,217 views
117


Show your Support & Get Exclusive Benefits on Patreon (Including Access to this project's Source Files + Code) -   / sasquatchbgames  
Join our Discord Community! -   / discord  

This is a pretty common setup, ESPECIALLY for top down games:
You Want the camera to average between the Mouse and the Player when using the keyboard and mouse, and you want the camera to center on the PLAYER when using a gamepad.

In this Unity tutorial, I'll show you a method that will work NO MATTER what your setup is. 2D, 3D, doesn't matter, this will work for your project.

I hope you enjoy!

Link to Download our free 2D Asset Pack:
https://veilofmaia.com/tutorial-asset...
---
In need of some Unity Assets? Using our affiliate link is a great way to support us. It's free, and we get a small cut that helps keep us up and running: https://assetstore.unity.com?aid=1100lwgBQ
---

Contents of This Video: ------------------------------------------

00:00 - Introduction
00:24 - Adding the mouse position to your input action asset
02:08 - Getting the camera to follow your mouse position
04:11 - Tweaking the method so it also works for perspective cameras
06:25 - Ensure the camera only follows the mouse if it's on the screen
06:55 - Detecting a change in control schemes
08:05 - Allowing gamepad mouvement while moving the mouse
08:34 - Changing the camera's follow target based on control scheme
09:27 - Controlling the execution order of scripts
10:26 - Smoothing out the camera transition

Who We Are-------------------------------------

If you're new to our channel, we're Brandon & Nikki from Sasquatch B Studios. We sold our house to start our game studio, and work full time on building our business and making our game, Veil of Maia.

Wishlist our Games:

Wishlist Veil of Maia! - https://store.steampowered.com/app/19...
Wishlist Samurado!
https://store.steampowered.com/app/23...

Don't forget to Subscribe for NEW game dev videos every Monday & Thursday!


Follow us on Twitter for regular updates!
  / sasquatchbgames  


#unitytutorial #unity2d #unity3d







Tags:
unity
unity2d
unity tutorial
sasquatch b
unity beginner tutorial
game development tips
unity clean code
unity camera
unity 2d camera
unity 3d camera
unity cinemachine
unity switch camera targets
unity switch cinemachine target
unity force cinemachine camera move
unity detect mouse input
unity detect mouse input perspective camera
unity detect mouse input new input system
unity detect control scheme
unity change controls
unity change control scheme