Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So we're going to add a component to our player here
A component is called an enemy
So type in
Animator
When adding your component in there we go
In a minute can also be called on mechanism in a meter superhero Googling for solutions for your own
Component you can Google mekanam animator
Now the area allows us to create a tree
Animations
And then sort through those animations based on certain parameters
I know that's confusing I know it doesn't make sense so I would recommend just following along with me and I don't make sense
When she kind of practise a little bit movie watch this video maybe once or twice ok
So when I click on window and go to
Animation
Animator
Ok
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
And this is a wonderful confusing
Window it's not as confusing as it looks already we got layers parameters but this weird
Also I'm going to go ahead and get a window
Animation in an animation
And I'm really use this down here
The animator window is where you manage
Multiple animations
Until unity which animation to play
Based on certain parameters
The animation window is where you actually enemy your character in the bones ok
So this is why you handle multiple animations
This is why you handle a single animation and what it does
Ok
So the first thing to do is just going to my scene view here
And I'm going to go ahead in click create just to show you guys how this works
Miniclip create animation
Alright so it's like we can create a new folder
And I think we should call this
Animation
Anything new folder called characters
Inside that folder and create a new folder
Call Claire
And I can go ahead in name the first animation in Italy player
Stand knows my syntax nice and clean capital space
Stand
Ok
Alright so now we have this timeline
If I click this record button
I can actually move around various parts of my player
And it will automatically create with cold keyframes
And tell unity this is where I want the bones to be at this specific
Frame
As you can see here we can
Click the record button and if we just simply drag the hands
My down to aside here can I give standing in place maybe
Do something like this
It's adding these weird looking diamonds and all these are our indicators to show
Hey unity
This is the position at 0 right
So I hit play what does only one frame so it just sort of stays there
Spotify play mode
Get see now
My pleasure is
Serve
Lupin position is only one frame again but it's looking so he's
Constantly playing this animation of him just standing there
And if we go to our animator tab
You can see
We have 1 animation as got player stand
And after entry
We are going to
Start the game and we're going to play this animation ok
Is my nan make sense so just hold on tight
And it will once we start messing around with various animations
Now I want to give you a quick note
If you guys aren't seeing
Your skeleton here
You want to make sure you click the sort of gizmos button
If you don't see it highlighter
You not going to see your bones you're not gonna be able to manipulate your character have definitely been confused before wondering where are my bones
Just be sure to click it and turn it on
And now we can actually manipulate our bones
So when were in the standing animation we can actually move
Are play head over
You might say
We want him to sort of breathe
Every second right so we could actually move his arms up a little bit like he's breathing
And maybe put him back in with his head like this
But you noticed
No keyframes
To the timeline
Or remember you got to be extra careful when you're working on your animations guys
You nearly has I don't know it's not the best animation system I'll be honest because it default
What's a preview mode when in reality I wish you would default to record mode ok
So now the world record mode I can pull my play head over to One S
And move his arms out just a little bit
And maybe shift his chest a little bit so something like this see you there
And I can highlight all of these
Press ctrl-c to copy them
Zoom out using the scroll wheel and get a 2 seconds
And now
He will stay in there
Embryo
Very cool
Now
We can also make him blink so let's go ahead and maybe startupblink here
And again make sure they were on record mode
I'm going to select this I hear
There we go to scale
And I'm going to shrink it down like the see that
Why you want to be careful though because luck watch
Is it a very slow blink
So what am I to do is actually take the first frame and paste it
Roundabout here and then another one right here
Do that
So now
Is blinkers fast
Here we go
So what's occurring by the way there's something called cleaning in twinnings was started a long time ago more than a decade
No between basically means you don't need the enemy frame-by-frame guys
If you're making a game like hollow Knight
You gonna use a lot of frame by frame animations
But I'll be honest I play that game and I realise there's some Twinning going on as well basically between means is indicating
And keyframe position
Mnm other keeping position in unity with some math is got fill in the gaps here's an example
If I rotate the head like this and I rotate the Head Like This
That's 2 frames but unity is going to fill in the gaps for me
So that's what makes animation so much easier in 2020 as opposed to in 1992
Ok so I'm going to delete those head rotation and just going to delete the entire property right here
And
Let's take a look here
How to get one eye blinking what's the other one
It's like that
Make sure we're on record mode
So what I'm going to do is I'm going to go to this key from here
Stream down the size and then again
Copy
The first name of this property which is a right scale
Inner peace
MPC here
So now he breaks what's going on here
And see how it looks
What is blinking
And
Barely breathing very cool
Awesome
I definitely like the way that looks
Ok
So
What's
Go ahead
And talk about something
That is a little bit complicated
But I believe strongly
Then I can help it make sense
You guys better than a lot of people try to make it make sense to me ok
Can I go ahead and click on the enemy tab ok
There's layers going to target layers in future episodes it might even be in the events section
But right now we're just going to go to parameters ok
What does tab mean is
What parameters
Are associated
With
The animator
Well if I create a parameter let's see here and let's see what can we do that's create
Will you create a parameter called
Grounded
And that's a bully and you guys my right bullions alright true false true false
True false in credit all kinds of primers
Guys be honest a perimeter is just a variable that's what it is it's just basically of variable
Associated with your animator ok
So I have
A variable called grounded
What is actually does this even mean
I know I already have a variable called grounded inside of player
The actual script
Meaning when he's on the ground
Grounded is set to true
Well I can actually send that information
Into the animator
And then tell the animator to
Play the jump animation
Based on if the player is no longer grounded again
Grounded equals Fosse
Ok
How many create a tonne of different parameters here in the slowly start using them
And make animation changes
Based on whether a promoter is true or false or whether a velocity value is bigger than 0 or
What's go ahead in create a few variables
Because I know that this is confusing this is one of the things that really confused me when I was learning unity
Don't panic
I know you might feel a little bit
Lasted right now but
Go along with me
Ms Crazies parameters
We're going to first create a float
IKEA creator
Vector to I don't know why but we can't create a vector 2
Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1
As a parameter but we can create velocity
X
Any we can also create velocity
Why
No why do we need these values
Because we want to send information from the player script into this animator component
This controller
And say hey the velocity of the player is 1
Let's play
What the running animation
Because well the velocity is 1
Or if the velocity is back down to 0 animation to be player stand
Instead of player run
So there is two variables we're gonna use we're gonna create another one we're going to call this a Trigger
And it's going to attack
A trigger is a lot different than a billion a bullying can remain true or remain false
Said it said I trigger just happens once like firing a gun
So if I say hey
Animator attack
If we're going to go
As opposed to UK animator grounded
Can be true until I tell her to be false
Alright we got grounded velocity
X why we get attacked
We can also create a hurt
Trigger
We can also create a jump Trigger
And when we create a few more here what about move Direction
As an integer
Not a float but just an integer
We create another one baby for future versions of this game may be attacked directions
If I punching down it'll be one animation if you're punching to the right it'll be another animation
And that's going to be integer and we can call it a tag
Directions get more specific attack Direction why so we punching up vs punching down
If you're not doing either
Then one is going to party left or right
Based on the move Direction
Ok let's see another trigger we could create
Is Flash meaning if the player is hurt or they collect health
We're going to play the flash animation so once that fires is going to immediately go to the flash animation
Again guys I know this is confusing just bear with me
So these are all of the parameters
Aka variables associated with this animator
Associate with the player
Am I going to use these to determine which animation plays guys we don't have parameters it's going to be
It's hard to know which animation to play
So again if we know that the players grounded is true
Then we can send
The animated to a new animation which is the standard information is grounded is false
It's going to send it to the jump in a mission
Well if we go ahead in
Hit seen and then hit play
I can show you what's going on here
What's jumping over these guys in stay and about right here
What's lighter animator window here
N n select our player
To take a look
Is there a blue Bar is indicating
The player is in the stand innovation and it just simply lupin right
We've also got all other parameters here but you can see they're all just sort of it though default value that's because
What have any script telling these parameters what to be
We don't know where the ground is true or false we don't know what the velocity is
These are not linked in any way to the variables associated with the players
And that is the new player script
They're just not associated in any way
We need to make them associate
So let's jump into a new player script in make that happen
When you go home double click on new player here
Are we going to open that up in Visual Studio
In the very first thing we need is a reference to the animator remember guys everything is pretty much
You know I can Pony that even NM are a component
On your player
For example if we open up on Unity Project and take a look at the player
We can see we have this animatorcontroller here
That's what they say is right when we look at this is basically just digging deep inside of this
Well we need a reference to that that's open up a script and what we're going to do is just create a new reference
A references section here
Remember we're going to be doing in alphabetical order
So we can put it right here it's going to be serialised
And it's going to be private
Going to be an animator component in this is call it in a metre with a lowercase a
Alright that's going to be a reference for the animator
And then we're going to do is we're going to go down to the bottom of her update and I'm going to create a new calm and I'm going to call this
Set each animator float
And Trigger
To it
So it knows which animation to fire
We're going to say a animator set float
Velocity
Eczema that promote
We're going to setup flow
2
The absolute value so mad after apps
The city of the player working in / at the max speed
So what this means guys is basically we're going to set the perimeter velocity x
Of the animator on the player
We're going to set that value
To the absolute value of a current explore City
Which would be something like it
You know -5 the absolute value would be 5 right as I was going to go to the positive number and then we're going to do
Buy a max speed so can be point 10.4
Or all the way up to a maximum value of 1
It's never going to be negative
Right
This allows us to basically say is the player moving or not
Is there a value greater than zero or not this also
Arrange between 0 and 1
I'm Gonna Save The Script then I'm going to go back into unity
And let's go ahead in hip play
So if we go ahead and Dragon animator tab over here so that we can see it while we're playing the game
Kindle the crowded you can see that if we click on our parameters here
The value is not being updated
Why is that
Because we haven't actually provided a reference so let's be sure to provide a reference so go to our player here
Got a new player and we're going to drag her animator component into that animator variable
That we created
Alright now it's Hitler
Ok so velocity is currently is 0
But as we ran look at that
It's slowly increasing in value
Based on our speed
The absolute value of a speed so doesn't matter whether I'm going left or right and also
It's been / the max speeds that means we're always going to basically get a percentage right and that's what this is
So if you are going to be
You know
In-between wanna a maximum of 1
Or when we stop 0
So hopefully that makes sense
Does this velocity x cannot change
The velocity of the player
Rather is reverse right
Has the players velocity changes all this does is basically inform us in it informs unit
Animator window
How fast do players going
Relative to the maximum speed
So let's go ahead and your back into her new player script I must go ahead and
Some other values for animator
So animator set float in guys whenever we do this sort of set
Function here it's just a specific function associated
With the animator component
Velocity
Why
Anyway
Said that
To the velocity
That's why
We don't need any real unique function here when I go to use an absolute value or anything like that alright those are the
Play two that I really need right now to determine if the players running or jumping
Samina save this out
How many jump back in the universe
What's go ahead in select or player
Can you get a create a new clip
And we're going to call this player
Ryan in Wigan make sure it's in our player animation folder
Click
Ok
Then click the record
Lol I'm going to do
I'm going to do for this
Is making
Have a very simplistic run stands so something like this
Ok
What is arms are a little bit
My bag
And what I'm going to do
Is a naggin a worry about the actual animation
I'm actually going to worry about the bounce I want it to look bouncy ok I mean it's like his pelvis
I mean it's like the move tool
And then I'm gonna put him down to that right here
And let's see
About here
Remove app like this
Anyway going to copy and paste
The first keyframes
Tapir
Alright looks good
Something like that
Ok so I can see a camel so he's on a rubber band is actually bouncing right
The way that we solve that
Is we can actually go to are curves here
Ok
And using this tool over here we can really zoom in your curves
Ok let's see if we
There we go
Resume into a curves
Just like that
You can seem to get a very smooth graph to it
If I make this like this
And like that
Now
He also his dancing see that
Does no longer smooth when he hit the ground if you had a jump in your fever to hit the ground
They would stop immediately
Can you dance again
I need smoothly go into the air
So messing with these curves really requires a lot of practise guide
And I know it might look confusing but we're going to be using these a lot so just follow along as best as you can
So that is going to be a run animation for now right that's about all we need
And we also have the stand animation like this see that
Ok so we're going to go back to your animator window zoom in a little bit here in now you can see that
As we created another animation we have this player run animation and it's a hanging out in the Aether right
Unity doesn't really know what to do with
Well we need to tell unity when to play this animation
Cell
The way that we do that is we can actually right click and play Stand
Click make transition
And now we going to drag this little arrow
To play Run
Here we go and you can move it around whenever you want it doesn't matter where they are
How do you say to stay organised
What does mean is that
Play wrist and is going to move
To play Run
After
We finished the animation
Well the first thing you want to do is double click and play around in over here you're going to see the inspector
Of the player Ryan animation
Looks like everything is set up properly all I was really worried about here was the loop time
All this means is that it's going to loop right and we definitely want to run a mission
The loop
Ok next what we want to do is select this transition here
Take a look at this weird inspector over this is very hard
Well you can actually spend a lot of time over here so try and understand as best as you can get to using this
So the first thing
That you're going to want to look at his this has exit time
All this means is
Do you want to wait
Put the playlist and animation to play Once
Before
Exiting the animation and moving to the player run animation
How much was go ahead in see what happens here
From what I can gather we're gonna play the playlist animation
And then we're going to transition to you the player run animation
So we have the entry
So when we hit play
Move the playlist and play Once
And I moved to play around
Please take a look and see what happens
There we go
So again will take a look
It plays the player staying in motion and then immediately transitions to the play Run animation
Well we definitely don't want that right cos he's staying in place
How do we tell unity to only play it
When I'm running
Well that's where the prime is coming
Because we now have this velocity explain matter we can create an if statement without even writing any scriptwriter
Use this little transition here
To determine when we should run
I'm going to select this transition here
Can I get a create a new condition
Ennis inspector field
We can't click the dropdown menu in look at all about parameters
So if velocity
Is greater than what's a point
1
Then it's going to play
The player run animation
Ok
Click play and see what happens
Derry girls
But now he's stuck
Why is he stuck now he's just still playing the run animation
That's because
Look there's no arrow telling you need to go back to the playlist and inhibition rate
Select this
Radcliffe
Quick make transition
And there we go
It's going to play the player animation
Ennis going to go back to PlayStation
Search for how to make a Windows a little bit bigger here so you guys can see
Get a little bit complicated here
Alright
So let's see how to make this
1920 by 1080 that looks good
And let's select a player and play
So I'm running
There we go
Almost there we go but I did see
It only plays once and then it goes back to play a stand
And we have to wait for that information to complete
Before even giving us a chance
To play that player run in a nation again
And this has to do with
Exit time ok so we can actually select these transitions here
Until the animator controller
Whether or not
You want to wait for animation to complete
Before moving to the next animation
That's really what the time is
Exit I'm means wait for the animation to complete before you even check
The condition
Where can I sell it right if I press the right or left
I really want to immediately go
To the player run animation so many diesel like that
But not transition
Parsley the same as true here as well
I don't want to
Have the player run animation complete before transitioning to play a stand
Tell me the disable exit time as well
You may wonder when you'd wanna use an exit time
Well what if you wanted to limit the players Billy the shoot a gun until they reload right
Well you have a reload animation you would require the exit time
Before they can put it back out in begin to shoot
Saturday play here and see how it looks
Why is it Glitchy you see that
It's not a stuck
Oh I see you finally sleep before me
If we look over in our actual inspector over here you see all the area here what is that Alexa playing
Take a look
If we select the transition from player run to player stand
You can see that it says
Transition needs at least one condition
Or an exit time
To be valid
Otherwise it's going to be ignored
So because we set exit time to force he doesn't know what to do now
So we need to add condition
What is that condition well
Velocity x
Is less than what was it .1
This one is greater than .1
Airport if it gets smaller than .1
When is going to go back to player stand
Alright let's take a look and see if this works
Great
What
So obviously the jumping is just horrible but
The running
Is working perfectly
Now if you don't want it to be that slow not to tell the transition
Between
Running in standings is can a slow write his hands go back to position a little too late
Well what you could do is actually say ok
I'm going to a transitions here and take a look here
Well we could make the
We open up our settings here we could actually make the transition Direction really fast right we can do
0.05 for both transitions
Say that out
Take a look
Yeah
Feels a little bit more snappy I like that
But you never stop even when I stop it keeps playing
So maybe what we can do is let's see here it's good game player and then go to Wellingborough train station
We can make velocity the required velocity to begin running something a little bit bigger right we can do point
3
And if it gets smaller than .3 so when he starts to slow down
Km Lee go back to a standing position
Does Google work
That feels a lot better
Ok
Perfect
Ok
So obviously the running animation is not complete we can obviously tweet that as much as we want have his legs move his arms
But for now when I want to do is get the jump
What's take a look at our parameters willy
When I jump look at the lottery if it's greater than 0
That means were jumping right
If it's less than 0 amines were falling
So I think we can actually create two animations guys
Would you have a jump animation and then we can have a full animation
In blend between the two
As he's going up and then going down
Super example if I'm jumping right now we would
Do a jump animation and then a fall animation jump animation fall in the mission jump animation
Animation
Search bar of here
Just a full animation right no jumping just ball
Alright so let's go ahead and those two animations
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.