make a person game This is a topic that many people are looking for. newyorkcityvoices.org is a channel providing useful information about learning, life, digital marketing and online courses …. it will help you have an overview and solid multi-faceted knowledge . Today, newyorkcityvoices.org would like to introduce to you Third Person Movement_Making Survival-Shooter Game in Unity_PART_1. Following along are instructions in the video below:
Hey everyone! This is a very detailed and in depth tutorial series in which we will try to recreate the World War Z game in Unity. This is a survival game in we will cover :-
►Third Person Movement
►Ammo-nation and Reloading
►Enemy Health / Player Health
And so on………..
WATCH THE FULL PLAYLIST: https://www.youtube.com/playlist?list…
Download Playmaker for free: https://drive.google.com/file/d/17lhK…
How to download paid Game Characters for Free: https://www.youtube.com/watch?v=ZmV4J…
Follow me on Instagram: https://www.instagram.com/howtodo_180/
How to Make Jetpack like StarWar BattleFront: https://www.youtube.com/watch?v=ZEAgL…
How to make Stealth killing system: https://www.youtube.com/watch?v=DJ0Uc…
How to make Sniper scope and shooting: https://www.youtube.com/watch?v=mBPiF…
How to make money system in Unity: https://www.youtube.com/watch?v=CyiHG…
How to get best Graphics from Unity: https://www.youtube.com/watch?v=7xa1Q…
How to make Hyper Casual game in Unity: https://www.youtube.com/watch?v=pjgOK…
How To Make GTA For Android: https://www.youtube.com/playlist?list…
How to make 2d Platformer Game for Android: https://www.youtube.com/playlist?list…
How To Set Up Android SDK in Unity: https://www.youtube.com/watch?v=_8qAL…
How to Change standard assets car to any car: https://www.youtube.com/watch?v=WyPgJ…
Watch parkour tutorial series: https://www.youtube.com/playlist?list…
How To Downlaod Unity Paid Assets For Free:https://www.youtube.com/watch?v=zXXES…
How to make any game in unity without writing any code: https://www.youtube.com/watch?v=h9mEI…
Watch how to make Dancing line: https://www.youtube.com/watch?v=PC4qR…
Watch How to make Menu in Unity: https://www.youtube.com/playlist?list…
Watch the Top_down tutorial series: https://www.youtube.com/playlist?list…
How to make a simple AR game in Unity: https://www.youtube.com/watch?v=KePGI…
Watch parkour tutorial series: https://www.youtube.com/playlist?list…
Watch GTA series: https://www.youtube.com/playlist?list…
How to rig and animate your character :https://www.youtube.com/watch?v=ynRSF…
Please like and subscribe to my channel
This tutorial series. We will replicate the game mold of our z in unity. This this will be really in depth tutorial series in which we will cover everything like lair movement system.
The ui. The multiple weapons different rebels will have a different damages. We should be able to switch between weapons and the enemy ai.
The ui the health. The enemy health to their health and the animations and all that good stuff so we will cover everything and we gonna make it everything from scratch. So of course practically all of this cannot be covered in just single videos.
So i will have to break down this tutorial series into multiple parts. This is the first part of the tutorial series in which we will learn how to make the player movement system along with the weapon. So along with all the weapon animations and all that good stuff so in the end of the video.
We will be able to make this but before we get started make sure you subscribe to this channel and hit the bell icon. So that you don’t miss any future videos and you get notified whenever i upload any tutorial video. Maybe the time you’re watching this video maybe.
I already have uploaded the multiple parts of this tutorial series in that case you have to click the first link in the description box below that will lead you to a playlist that i will create in which you will find all the parts of the tutorial series that i have uploaded all in order. So from part 1 to 3. And also so with that said.
Let’s get started so here. I have a scene simple scene setup. I’m using hd.
Rp strv. Basically. This is a high definition in the pipeline.
So if let me just quickly show you guys i’m using unity 2018 point 314. And if i come over here and make a new project. I can rename this project to wwc as i have just done it over here you can select the location and you can also set the template in my case i have set it to hdr p high definition render pipeline if you are making the game for pc.
Then you have to use a str p. You don’t have to use. But if you want to get good graphics.
You can use sdr p. And if you want to make a game that is performance more of a performance than the quality then you can make it on a lightweight render pipeline basically it is used for mobile devices but in our case we want to make a game for t pc. So we gonna use hd rp once you do that you have let us hit create and it will give you a new kind of a scene that will look something like this then i simply went in ahead.
And deleted. The example assets and imported. The this thing and no jong hyuk on ik japonica from asset store.
It is free.
It’s basically just this prototype blocks and things like that so i just imported them and displaced them like this so. That we have some kind of a map kind of a thing so basically. It’s nothing much and then of course.
We have a main camera. The directional lights and post processing. That is nothing much we’ll just a simple post processing that you get from the hd.
Rp. Any volume settings both of them are the same that you get from the example assets and then i have this simple scene with a floor. Some these guys and all that so basically nothing much is going on now if you want to make a game and that is third person of course we will need a 3d model of a character now you can go ahead and make your own 3d model of your character using a 3d modeling software like maya 3ds max and blender blender is free so you can use that but but but if you don’t want to make your own 3d model as it is time costly you can simply go ahead and download it for and download it from a website in my case.
I already have a downloaded one which is this one and his name is father i don’t know why because i haven’t played the game. It is indeed. This guy is from game called shadow war killzone something like that so i just downloaded it from here if you don’t know how to get character’s 3d models from any game almost any game you can see this video in which i show you guys how to get 3d models from any game 2090 and you can simply download them and import it inside over here.
And i have these the materials over here. So let me just go ahead and real quick add the materials and this is how it looks like with the materials. There we go once you have your character in there.
One thing you will need to do is you need to rig this character now sometimes you will get a fully rigged character in my case mine was not fully rigged so i had to rig it and so if you want to rig your character basically it means. If you want it to be animated of course. We want it to be animated.
So we have to rig it basically we have to add some bones in there so in order to do that i’m gonna use a site call to mix mode comm go ahead and import your upload your character from here you can just click that and simply go ahead and drag and drop your character in there. And basically it will automatically rig everything up for you in my case. I have this wolverine over here.
I was just testing something out and this guy is now fully erect as you can see okay so we can go ahead and find multiple animations over here in my case we want some kind of a rifle rifle animation so i’m going to say rifle and my caps lock is on so i have to close that and as you can see now we have all of these good animations best thing is that these all of our fully free. So you can just go ahead and download them so you can see we are here this is the rifle idle that looks something like this you can simply go ahead and download this and import it inside of unity. So if i just quickly download this and say download it is gonna prepare your download and there we go the rifle idle animation is downloaded once it is downloaded you can just simply drag it inside of unity out here just like that and here we have the animation.
If i go to the animations. There we go he is doing the animation nothing watch what he’s doing a subtle animation good now one thing that you need to do is you need to select your character the main character in my case it is this one make sure you your rig is set to humanoid this is a really important thing otherwise you your animations won’t properly work and of course same goes for the animation make sure. It is humanoid and hit apply okay.
So i’m gonna go ahead and real quick download some animations and yeah so here we go i just downloaded these four animations. One is idle that he is just simply holding the gun. Just like that then it is jogging just like that then he is also running just like that and then he is stopping from the running and going to the idle in all of them.
If i select all of them and go to the rick as you can see all of them are set to human right. This is really important so you have to set them to humanoid if i go to the idle go to the animation as you can see i have checked marked all of them that are green so loop match loop man luke meth. Loot map you have to simply check mark all of them that are green.
If i come over here go to jog as you can see all of them are green. Except this so i haven’t checked mark this one make sure you don’t checked it and check mark this loop pose. Because yeah.
It will mess up your animations.
So make sure you don’t check mark that otherwise just check mark everything. That is green in this running all of them are green. So i have checked mark them and one is red.
So i haven’t and in this case. In stopping one he is dropping like that so loop is not checked green. So i haven’t checked that of course it we don’t want him to look this again and again because he does not matter of course and then this is green.
So we have set it to yeah and if i uncheck that you can see there is a little artifact going on in here. So i just simply check to mark there. If i check mark this one.
He just does that and that is not what we want right so. Good. That is just what we did so the here are for animations now.
If i select a player. There is an animator controller and animator component on the player here over here and in the controller. It is empty.
So we have to make an animator controller for the animations so effects right click create animator controller. I’m gonna call this one player just like oh there okay and if i said if a clear drag. I get the blue animator controller in that slot bam.
If i double click the player animator controller. As you can see a animator window opens up and it is basically empty these are just a premade stairs. That we don’t have to take care of anything about so i’m going to go ahead and simply drag in the idle at first there we go and i have to rename into idle.
There we go. And then i’m gonna go ahead and drag in the jog basically it will work as walk so i’m going to simply rename it to walk. And then i’m gonna go ahead and drag in the run run and we will see about the stopping one later on we’re not gonna use it that right now we can use that later on okay so if i go ahead and right click on the idle.
There is a option to make a transition and if i make transition. There is an arrow. If i select the arrow and click on the walk animation.
It basically makes an error if i select the arrow that is the transition in if i play it over here you can see there this is the idle animation and this is the walk animation. So basically it will transition from idle to walk just like that basically jog so it’s transitioning and that there is a condition slot over here. And if i say plus sign over here.
It says parameter does not exist in the control or content. No i don’t know what i said was yeah. There’s no parameter okay so we have to make a parameter over here.
So if i select the tab for a meter over here and plus sign and if i say float the float basically is a point pointer value and if i name it to magnitude simply. Mag and now you can see there is a slot over here and in fact. I can select mag magnitude.
And if i add the condition that point one that is the magnitude is greater than the point one we are gonna go to the walk and make the transition to that and say if magnitude is less than point one i’m gonna real quick explain what is happening over here so we just made a loop from idle to walk.
And there is there are two arrows and one arrow. That is from idle to walk says that when magnitude the value of the magnitude variable is greater than point. One.
We are gonna go to the vulcanization and if it is less than point one we’re going to come back to the idle animation. If i play the game right now and let’s see what happens i’m gonna select up there and there’s the player i’m gonna select the camera first and say controls you have to f so that the camera comes over here. And now you can see the player is doing the idle animation over here.
If i set the value of magnitude to one. He is gonna complete the animation and then transition to walk and as you can see he is walking and if i set this to zero of cane oops zero come back to the scene. He is over there and he has stopped if i real quick come over here set the camera over here.
So that we can see what is happening go to the animator and set this to one he’s gonna walk and if i set this to zero. He’s gonna stop just like that okay so everything is properly working one thing that you will notice that if i set the value of magnitude to one right. Now.
The animation of the idle will fully complete and then it is transition to walk that is not what we want right so in order to fix that we can go to the arrow. And just uncheck as exit time is equals to true so we can uncheck that and same goes over here. So now everything basically should work okay.
So basically what we want to do is we want to control the value of the magnitude from the can from the code. So if we press them to asd. We want to change the value of the magnitude basically now here comes decoding.
So if you’re new to this channel. Then let me tell you guys that we don’t do any coding in this channel. Because we use playmaker everything is just saw in the beginning of this video was made entirely without writing a single line of code.
It was made entirely by their maker. If you don’t know what their maker is playmaker is really cool asset that helps you make games without writing a single line of code. It only requires basic logic of game development.
It does not requires you knowledge of the code and syntax and all that it basically helps you make games with just simple clear logic. So if you want to get playmaker you can simply download it from asset store or buy it from asset store. It’s not free.
But if you want to download it for free the link will be in the description box below. I personally will provide it to you guys for free. So you can just simply go ahead and download this so once you’ve downloaded you will get something like this you will get this blame maker and you have to just simply drag it inside of unity.
Just like that bam and it will uncompressed there and it will say import you have it’ll simply say import once it is imported you will see a window. Something like this and then you have to say install to their maker. Install clear maker.
I have made the backup go ahead and will decompress and then you will have to say import again or just. Like that okay. So you have the same import and once it is imported you will be able to see this folder.
The playmaker playmaker.
Plug ins presets like no not pretty chose gizmos. And yeah go in these good things okay. So once you have imported playmaker.
If you go to the player. Say add component and say fsm you will see the playmaker fsm over here. So this is basically the playmaker.
It is basically kind of like a flowchart so in here. What first thing we need to do is we need to check whether or not the player is pressing the wasd so how we check that is by saying you get access vector vector. Basically is a direction.
So we kind of get the direction. And it is already set to horizontal and vertical basically if i go to the edit project settings and input real quick to show you show you guys horizontal and vertical are here. Which basically are a d and w s.
Okay. So wasd basically this is horizontal and vertical wasd. So it is already set by unity.
You don’t have to do anything ok. So if the player presses wasd. We can store the direction in a new variable the vector basically direction.
We can store this in a variable called input vector. And there is also a slot for store magnitude for you and gonna store the magnitude into input magnitude so input smack there we go now if you don’t have to do this i’m gonna real quick show you guys if i select the input magnitude it inspector so show inspector if i come in here and say controls we should be able to see the input magnitude over here. If i play the game.
Right now. Now basically the input. Magnitude is a float float is value in points.
And when the game starts. We are in state. One in which we are getting the access vector and the value of the input.
Magnitude is zero. If i press w. You will see the value of input magnitude changes from 0 to 1 if i press a it’s gonna come back to 1 and if i press wasd.
We are gonna change from 0. To 1 just like that and if i go to variables. Select.
The vector and say inspector. And if i press w. You will see this value changes to z in 1.
If i press s.
It’s gonna change in 1. If i press a it’s gonna change the minus 1 in x and positive 1 in a when i press d. So basically values are changing on pressing wasd.
So that is pretty cool now we wanna set the values and we can use these values to derive the animations. So basically what we are gonna do is we can set this float equal to the magnitude that we get over here. So we gotta go ahead and say set animator float the the magnitude.
Which is exactly this one and we’re gonna set it equal to the one that we just stored in perth magnitude. And we’re gonna say every frame every frame basically means every second now if you play the game. We should be able to move the character when we press wasd and there we go he is doing the idle animation.
If i press w. He is gonna walk and if i release w. He’s gonna stop if i press s.
He still is gonna go ahead and move forward and ya so of course we’re gonna fix every single bug owner here but okay so we want the direction also be changed. If i press wasd so in order to do it we’re gonna go ahead. And say smooth look at direction.
And the iteration is the one that we just stored input vector and we basically don’t have to do anything now. Anything else if i play the game right now basically everything should properly work. If i press a he should come towards the camera.
There we go and he is moving in all directions of course. He is not gonna collide with anything at all like that he’s gonna just pop out of everything everything and he’s gonna go right in the stairs and all that but we’re gonna fix everything. But basically the player is moving with wasd so that is pretty cool next thing that i would like to do is is set up the camera.
So i’m gonna go ahead and sell the player and say right click create an empty game object right inside the player. And i’m gonna go to the side view or there we go and move it up to his hip or the chest position just like that i’m gonna call this one camera follow this will be the point where the camera will follow and i’m gonna duplicate this and i’m gonna rename this to camera base base there we go oh there we go okay i’m gonna go ahead and drag out the camera base just like that and i’m gonna select the camera and drag it inside of the camera base just like that and i’m gonna go ahead and reset. The camera transform and bring it out and bring it up a little bit and rotate.
It just like that and basically position it like a third person camera control and bring it little up and then also move it back a little bit there we go good then i’m gonna go ahead and select the camera base and say add component fsm again and this time. We’re gonna go ahead and say move towards basically. It means follow move towards and we kind of move this camera base to the camera follow there we go make sure the finish distance is zero.
And we also want to move the camera with w. Arrows. We also want to move the camera with the mouse.
So we can assay mouselook mouse look there we go and it is already set i’m gonna decrease the sensitivity to three and three and let’s let’s see if if it is working or not yeah. One thing. That is the y axis ville is always inverted so we will have to fix that but as you can see we are now in a third person camera control of course the y axis is inverted so in order to fix that we’re gonna go ahead.
And say instead of three we kind of set this to minus three. Now. Everything is probably working.
Good so. The flare is moving and everything is working fine. One thing that you will notice is that if i press w.
Is moving forward right. But if i set the camera direction to that and if i press w. Now he should move in that direction within.
Which we are looking. But he is not so we have to fix that so if i come out of the game view you will see the minus sign just vanishes because everything that you do in the game mode. It does not saves.
So we have to just add the minus sign again. I’m gonna go ahead and close that come back to the player and say edit and in order to fix that directional problem. You basically have to just simply again the camera in the relative to slot in the cat access vector.
So now if we save the game and play the game basically everything should properly work. And there we go everything is working. He is moving in the direction.
In which the camera is looking now one thing that i am noticing is that we do not have any collisions bam okay now we need some collisions so in order to do the collisions we are going to use a collector controller so if i select the player and say add component and say character controller there we go there it is it basically looks like a capsule collider. I’m gonna reposition it to move that move it little up decrease the radius little bit and crease the height a little bit there we go and that will take care of all the collisions. If i play the game right now and by the game.
And now we should be able to climb this slope. And there we go we are climbing and doing the old kind of the collisions amen. We are also falling that is pretty cool now.
If your character is not falling. It means you have not done one thing that i’m gonna just real quick show you guys if your character is not falling. Like this.
Then you have to come out of the game view and select your animations animations. Mainly the or all of the animations and you have to make sure you have checked mark these two guys alright in my case. I have in the aisle.
I have in the running. I have checked mark these two things okay so if you have done that your character basically should fall next thing that i want to add is the running of course. We don’t have any running right now.
So i’m gonna go ahead and double click on the player. And we’re gonna make a transition from walk to run and from run to walk and this time. We’re gonna go ahead and make your bouillon bouillon basically is true or false and i’m gonna set this name to run if running is true we are going to if running is true we’re going to the run and make sure the hazardous time is false if running is false.
We’re gonna come back to the walk that’s easy time is false now we have to control this running true and false from the code. So we’re gonna come back to the player say edit. And basically i’m gonna go ahead.
And say control c control v.
No. And there we go we have a state to basically it is same as that i’m gonna delete the set animator float and i’m gonna say set animator boo and we’re gonna go ahead and set. The animator bull run.
Which is this one make sure the spellings are same so run and we’re gonna set this to true there we go i’m gonna copy this and paste it in here and make sure it is false when it is walking okay now we have to transition from fog to run when via hold certain button in many games. When we hold the shift key. We basically run so if we go to the edit project settings input and this time if i go to the fire.
Three basically you can see it is left shift fire three is left shift. So these are the controls made by unity these are the default controls. So we’re gonna go ahead.
And say get a button down basically. It means when we hold a button get button down. And the one that we need is fire three basically.
It is left shift. And we can go to the new event. And say run so right click add the transition run bam and in here.
We are going to say get button up which means when we release the certain button in our case. We of course one fire three left shift and we’re gonna go ahead and make a new event say walk so if you release the shift. We can go back to the walk.
Simple as that okay now basically everything should properly work if we have done everything properly. I’m gonna go ahead and play the game and see so we are walking if i hold the shift key. He is gonna run and if i release the shift key.
He is gonna come back to the walk running walking run basically. He’s not walking he’s jogging. So i’m gonna go ahead and real quick change the animation from jogging to walking so if i search in walk forward loop.
And it is over here there we go here’s a walking loop. So i’m gonna go ahead and select the walk drag it in here and then take him now he should walk you don’t have to do it i just did it for you guys to see that the running animation is properly working. So he is walking just like that and if i say run.
He starts running been to so. It is properly basically working. I am loving it and he is running and walking when we hold shift basically this is the third person character controller.
And yeah. It is working next thing of course. We need to add a d gun.
So in order to add the gun. And why is this guy floating. So if i say pause the game come out select the player maybe.
It is the character controller.
It is little big. I guess so if i select the character to controller make it little smaller because he is just floating. There we go he is now not floating good okay.
So the character controls were not said. What yeah you can fix that good now we want to add a gun so in order to do that of course you will need a gun 3d model in mike is i already have downloaded it you can just go and download it from sketchfab. I just downloaded from sketch.
5. I guess i don’t know i’m going to simply go ahead and drag it in over here so this is the gun 3d model. I’m gonna go ahead and bring it over here somewhere and position it so rotate it like that rotate it like that maybe make it a little bigger just like that go in here make it go up.
And i guess. The gun should be rotated like this bam. Good once you’ve position that you have to go the player in mix.
No hips spine spine. One spine. Two left shoulder left arm left forearm.
And left hand. So you have to simply drag in the gun in the hand. I’m gonna unpack the prefab just like that there we go and now if we play the game.
And then pause the game. We are going to position it right now so pause the game go in the front view and of course. The gun is not positioned properly.
So we will have to rotate it like to the head a little bit move it in and i think it is little big. I guess i don’t know make it little smaller. Just like that and do that there we go i guess now it’s looking good.
I’m gonna go ahead and copy the component copy component. Get out of the game view now you will see the component values will change there we go we have to paste the values and there we go. And if i play the game right now basically the gun should properly work there we go.
He is holding the gun. And he is also walking me the gun and running with a gun good and this is how you make a third person character controller so in this video. We just covered how to make the third person character controller.
He moves around walks around with a gun and also runs around we have set up the camera and in the future videos. We will make a shooting system so if we go ahead and right click. We should zoom in and he should do that thing.
And then there should be also a crosshair in there and of course. We will add a camera collision because right now. We don’t have any camera collision.
So we are gonna go ahead. And do multiple. Things we are gonna cover everything and this tutorial series will be really in depth and really really informative maybe i don’t know so if you don’t wanna miss any future videos make sure you subscribe to this channel.
And it that bad icon. So you don’t miss any future videos. And yeah stay tuned.
Yeah. I guess that’s it hope you guys enjoy it and i will see you in the next video till then peace out .
Thank you for watching all the articles on the topic Third Person Movement_Making Survival-Shooter Game in Unity_PART_1. All shares of newyorkcityvoices.org are very good. We hope you are satisfied with the article. For any questions, please leave a comment below. Hopefully you guys support our website even more.