How to make a 3rd Person Shooter in Unity | Cinemachine & Input System

Uploaded by samyam
Share: Twitter Facebook
Build your own 3rd person shooter controller in Unity with the new Input System and Cinemachine from scratch. I’ll show you how to move your character with an Input Action Asset, the PlayerInput component, and the Character Controller component.

The player will have two Cinemachine Virtual Cameras (vcam), and when the user aims down it will switch from the third person view to the more zoomed in third person view, and vice versa. This will use the new input system thus we will use the Cinemachine Input Provider to override the old input system values.

I’ll also show you how to add mild perlin noise to the cinemachine camera to add a nice sway effect. Additionally, we will use the Cinemachine Collider extension to have the camera avoid crashing with the walls in an awkward way.

For aiming, we will use Kenney’s Crosshair Pack, linked below, to add a reticle to the center of the screen on our canvas. There will be a vcam switching script to switch between the different vcams and activate the corresponding reticles.

Our bullet is shot out of the barrel of the gun with a raycast, and if the bullet hits the environment it will spawn a decal with the correct orientation normal to the hit point.

This is a long video but I hope you all enjoy and learn a lot! In the next video I will be going over adding animations to our player, and (if not the next, the next next) then use the animation rigging package to have the upper body aim up when the player aims up. ?

► ? Here is the Source Code for this video!!! ?
https://www.patreon.com/posts/52054165
►Adding Animations | Blend Trees, Layers, & Animation Rigging - 3rd Person Shooter - Unity Tutorial
https://youtu.be/583R9LgRZPA

►Character Controller Move Script ?
https://docs.unity3d.com/ScriptReference/CharacterController.Move.html
►Kenney Crosshair Pack ?
https://www.kenney.nl/assets/crosshair-pack
►Bullet Hole Decal ?
https://opengameart.org/content/bullet-decal

►Stephen Ward helped edit this video!
Here’s his contact for business inquires:
stephenwardediting@gmail.com

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!

? Other Cool Unity Assets ?
ᐅPeek - Editor Toolkit: https://assetstore.unity.com/packages/tools/utilities/peek-editor-toolkit-149410
ᐅEditor Console Pro: https://assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889
ᐅRainbow Folders 2: https://assetstore.unity.com/packages/tools/utilities/rainbow-folders-2-143526

►⏱️ Timestamps ⏱️
0:00 Intro
0:52 Package Manager
1:47 Scene Setup
3:13 Input Action Asset
6:36 Player Controller
13:08 Cinemachine Samples Project
13:34 Switching Input Handling to Showcase Sample
14:00 Cinemachine Samples Cont
15:15 Cinemachine 3rd Person
16:22 Why VCAM and not FreeLook
16:57 Cinemachine 3rd Person Cont
18:27 Cinemachine Noise
18:57 Adjust Cinemachine Settings
19:50 Cinemachine Input Provider
20:20 Aim Look Settings
21:24 Update Player Controller Script
23:45 Player Rotation
25:57 Aim VCAM
26:53 Switch VCAM
30:20 Blend Settings
30:45 Cinemachine Noise
31:00 Cinemachine Collider
33:14 Reticle
36:53 Add Gun
37:15 Layout Sidenote
37:38 Add Gun Cont - Raycast
43:40 Bullet Controller
47:55 Decal
49:54 Spawn Bullet
53:41 Decal Fix
54:29 Bullet Fix
54:50 Lock Cursor
55:15 Fix Cinemachine Collider
55:38 Next Video Preview
56:49 Outro

??THANK YOU TO ALL MY PATRONS FOR MAKING THIS VIDEO POSSIBLE??

❯❯❯ My Links ❮❮❮
? Patreon ?
https://www.patreon.com/samyg
? Discord Server ?
https://discord.gg/mj3dSnmaZc
? Twitter ?
https://twitter.com/samyam_utube
? Facebook ?
https://www.facebook.com/samyam.youtube/
? Music ?
Ambient Gold
streambeats.com
? Like and Subscribe! ?

?️ Computer Setup ?️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

#unity3d #unitytutorial #learncoding