Switch camera TARGET based on control scheme (Gamepad and Keyboard and Mouse) | Unity Tutorial
https://www.youtube.com/watc...Join our Discord Community! - https://discord.com/invite/aHjTSBz3jH
Show your Support & Get Exclusive Benefits on Patreon (Including Access to this project's Source Files + Code) - https://www.patreon.com/sasquatchbgames
Wishlist Veil of Maia! - https://store.steampowered.com/app/1948230/Veil_of_Maia/
Wishlist Samurado!
https://store.steampowered.com/app/2343270/Samurado/
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 2D Asset Pack:
https://veilofmaia.com/tutorial-asset-pack/
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.
Don't forget to Subscribe for NEW game dev videos every Monday & Thursday!
Want to be FIRST in line when the Free Demo is released?
Sign up for email updates and first access to the demo @ https://veilofmaia.com/
Follow us on Twitter for regular updates!
https://twitter.com/SasquatchBGames
***Purchase Links***
For those that would like to support the channel, please consider using the affiliate links below should you purchase a recommended product. We really appreciate it!
Equipment: We've been asked what we use, so here it is:
Microphone: Blue Yeti
Purchase in Canada: https://amzn.to/3WUXcWO
Purchase in USA: https://amzn.to/3Tke468
RGB Lights:
Purchase in Canada: https://amzn.to/3tflrkR
Purchase in USA: https://amzn.to/3g0Ci7L
Keylight: (Note: We use 2 of these for our lighting setup)
Purchase in Canada: https://amzn.to/3UINapv
Purchase in USA: https://amzn.to/3hq7sWx
#unitytutorial #unity2d #unity3d
Home
/
Indie Game Developers/
Sasquatch B Studios/
Switch camera TARGET based on control scheme (Gamepad and Keyboard and Mouse) | Unity Tutorial