All language subtitles for 007 Implementing the Ground Slide[UdemyIran.Com]

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In this video we're going to implement the ground slide ability.

In this type of Megaman clone games, you usually have a slide that just makes you go faster and maybe

has other properties.

So we also want to implement this.

But making something slight on the ground is actually surprisingly hard.

In Unreal Engine.

We've already used the launch character node before, and most tutorials you see will actually use this

node for sliding.

However, that is a very bad implementation.

The problem with this is that you have to set it to a super high value to work against ground friction,

but if you then use the slide near a latch, you're just going to fly off super far away.

The best way for things like this is actually something like root motion.

However, with 2D animations you don't really have root motion.

That is more a 3D concept, and also you cannot control baked in root motion.

So this is more like a root motion like solution that comes from the gameplay ability system.

And you can look up the gameplay ability system of Unreal Engine.

And it is a really big plugin that gives us many other features.

However, we don't want to use this because this is very bloated for only wanting to use this one node.

So I actually made a free plugin that only extracts the one node that we need for this root movement

type of thing.

And I'm going to show you how you can quickly install a free plugin like this.

And then we're going to use it to actually implement the ground slide.

I actually also made a YouTube video about this topic, which also shows examples from other real games.

So you can also check that out in the resources.

I'm not sure if it's already released by the time this course is out, but I will attach it once it

is available.

The plugin is called Root Movement and I'll attach it to this lesson in the resources, so please download

it now.

If you bought this course, of course, you can also feel free to use this plugin for all of your other

projects.

After downloading it, you should have this zip file again.

We want to unzip this so extract.

And in here we can just have a look.

We have the root movement you plug in, we have the resources.

And all of the files are in here.

Right.

So this is a packaged plugin that can be used in C plus plus projects and in blueprint projects as well.

So how do we use this.

Well we can go back to this folder the root movement 5.3 and just hit control X to cut this out.

And we now need to add this plugin into our project.

So this is not going to be an Unreal Engine version based plugin like paper Z and paper 2D.

This is going to be a plugin we put specifically into this one project only.

And we could then also develop this plugin alongside our game.

The easiest way to find your project is to just find the project and right click and show in folder.

And in here we then want to right click again and create a plugins folder.

So new folder plugins and double click to open it up.

And now we just paste our root movement plugin in here control and V.

And for this to take effect, we actually have to restart our Unreal Engine project.

So please do that now.

Just go to the project and make sure that everything is saved.

Save all and exit out.

And then just open up your project again.

And now you might get a message that says new plugins available and you can just click on Manage Plugins.

Also, if it says project files out of date, just click on update and open the editor.

This doesn't matter, right?

But we can also just go here to edit and plugins.

And now we just look for the root movement right.

So this is the new root movement plugin made by Cobra Code.

And it is already active because we restarted the project.

And we can then see this in our content drawer.

If we collapse the content we see the plugins folder here now right.

And in here we have the root movement content, the root movement C plus plus class.

And this is actually a C plus plus plugin that I created.

If you have Visual Studio and everything installed you can actually look at the code in here if you

want to.

And you can get a better understanding of how this works.

But we're not going to get too much into it.

We're only gonna go over how we can actually use this in our blueprints.

So how do we use this?

Well, this has a function library.

And what a function library does.

Is it makes certain functions available in all other blueprints.

And this is how I set this up.

So simply by having this installed in the plugins folder, I can now access this in any blueprint that

I want to.

And we want to access this of course in the player.

So blueprints characters player and go to BP player.

And in here we now want to.

Well, first of all, we want to go to the event graph and look for our jump for the IA jump.

And the way we want to trigger the slide is if we press jump while down is also being held.

But for now, let's just use this on jump and just see how it works.

So for now, we just click alt and here and stop the jumping.

And instead we just want to use this for the sliding.

Now for testing.

And I can just drag off here and just type in root motion.

And here we have these two functions the apply root motion constant force and apply root motion constant

force with callbacks.

And these are the two functions I created which are in this plugin.

So the first one doesn't have any callbacks.

And this is a monstrosity if you look at it first because it has a lot of functionality built in, you

don't need to understand everything that happens here, but just the basics.

The one problem with this though, is that it only has an input and an output.

It doesn't tell us when the event is over, it doesn't give us a way to cancel the event.

But if you just want to trigger something and just let it happen, don't worry about it anymore.

You could use this, but we actually want to be able to cancel the slide if we get hit or get stunned,

for example.

So again, we want to look for root motion and we want to apply root motion constant force with callbacks.

And this gives us and actually connect to the right side.

For some reason I go from started to the left side and then disconnect this in case this also happened

for you.

And this actually gives us the Oncompleted event, the on fail event.

And it also gives us the async action.

And here we can actually call cancel.

So if we get stunned or something happens, we can just link in here and cancel the slide.

The slide movement.

So this is very important.

But for now let's just try it out.

What happens if we put something in here.

Right.

So the first important thing is that we need the character movement component, which we want to call

this root motion on.

So we can just grab the character movement and pass it in here.

Otherwise nothing is going to work.

So this is very important for the world direction.

We can just get actor forward vector.

And this is just going to give us a x of plus 1 or -1 for left or right.

Strength is of course how much power we want to give the movement.

And for now just put in like something like 700 for testing.

And the duration is of course, how long the slide is going to be or the movement.

Right.

Because you could also use this for other types of movements.

And I think 0.2 is a good value to start from.

And the rest is actually not so important.

These are just additional things.

Features we can use.

You could pass a curve, for example, to make this light start out very fast and slow down over time.

We could carry on the velocity if you jump out of the slide like in Donkey Kong games in the Donkey

Kong country, uh, remakes.

This is a very, very often used gameplay mechanic where you just use your dash kind of to build up

momentum, and then you jump out of it to carry that momentum into your jump.

And this is what happens if we maintain the last root motion velocity.

So I like the setting.

You could clamp it.

You could set it all of these things.

And also important is the enable gravity.

So if you want to make an air dash or something like that which should ignore gravity, we can just

keep it off.

But we actually want to make a slide.

So if we slide off a ledge we actually do want gravity to take effect.

So we want to check this and set it to true.

Right.

So now we set up the basic things here.

Let's just try it out.

Go to the map and I press jump or Space.

And you can see we get this nice little slide right.

And you cannot steer against it and things like that.

Right.

It kind of takes over your character.

But we aren't playing the animation yet.

But this is working.

So this is the movement itself.

It is working.

So now that the slide itself is working, we want to just use this for the jumping again, right?

We can just use the started for the jumping again.

And we actually want to introduce a branch here so that if we press jump and our holding down we then

want to execute this instead.

But we actually don't have an input for up and down assigned yet.

So we first need to do that with the input system.

Go to the content drawer and the content input folder and actions.

We already have the IA move right?

But because we can only walk left and right in our game so far we only set it up as an axis mundi.

But actually now we also want to have the down and up input, the down input we want for the sliding,

like I said before, but later on we are also going to implement ladder climbing and for climbing.

We also want to have the up input as well.

So we can just go from axis 1D now and go to axis 2D.

So this will give us left, right, up and down at the same time.

And we want to save this and go to the input, the IMC action.

So nothing has changed yet, but we are now able to also put in more buttons for up and down.

Right?

So under the I move I now want to implement the button for up.

First let's just do this and add one here and put it to W.

And the default axis for movement is left and right.

So that is y D and A are working.

But for w we need to add another modifier.

So for modifier we actually want to use the swizzle input axis values.

And this just lets us go from an x axis to a y axis.

And this is all it takes because for the y axis up is the default direction.

So then add another one.

And here instead of w we want to click on s.

And s is the down button for wasD controls.

And again here we need to swizzle on the modifiers.

Swizzle input axis to go on the y axis.

But here we also need to negate like we did for the A right.

Because A is left, we had to negate it, as you can see here.

So for the S we just do the same thing.

Just add another one on top of swizzle.

We also want to negate and then just save this.

If we go back to our blueprints.

Now compile and save, we're actually going to get an error right.

So this is well we can just click here to see what's going on.

And the problem is that our IA move now turned into a vector 2D.

So we can actually start at the first one.

Right.

So the uh enhanced input IA move.

Now these uh now these pins don't match anymore.

So these are for the X right.

We want the x.

So here we can just disconnect this and we right click and break uh split struct pin.

And now we can split the x and the y.

So here we need the x right for the left and right movement.

And for the rotation.

We just need the x and the y we can then use for other things later like the ladder climbing.

But now just compile and save.

But there's still something left here like the float times float right?

Because for the tri wall slide, if we check if we are looking towards the wall and pressing towards

the wall, we also just check the x.

So here we can again disconnect this hold alt and left click.

And here split the struct pin and we only use the x.

In this case we don't care about the y at all.

And we can just compile and save.

And for now let's just go in here and everything works again, right?

We can walk.

The wall slide is working.

The jumping is working again.

But now we have set up the inputs which we can use for the climbing and also for the sliding.

So now let's set up the sliding.

And again in the BP player this getea move.

We actually want to use this for the slide as well.

So we can just copy this and go to the event graph.

And we can look for our IA.

Jump right to teleport here.

And now here we want to add yet another branch.

So first we just check for is wall sliding.

And if we are not wall sliding well then we want to check.

Are we holding down.

And then decide do we jump or do we slide.

So here we can just drag off and branch another time.

And here we can just, uh, control V to put in our get move.

If you didn't copy it, we can just look for get IA, move here as well and use this.

And here we just want to check if the Y which is the up and down if this is less than zero.

Right.

So this means we are currently holding down.

And I can just add a comment here is holding down.

Add a small o.

Like this.

Right.

So if we are holding down, I actually want to change this.

So hold Ctrl.

And if we are not holding down we want to jump.

This is fine.

If we are holding down well then we want to slide.

So we can use this here this monstrosity of a node.

And if we are holding down while jumping, well we can do the slide instead.

Compile and save.

And let's check this out.

I'm not holding down, I'm just pressing jump.

I'm jumping, I'm holding down.

And now kind of sliding over to the side.

Right.

Jumping.

Sliding.

One problem you might notice here is that if I press down now, the character just starts looking to

the right side, even if I just press down and no direction.

And this is actually related to the changes we made to the 1D and 2D axis.

So let's just fix this quickly.

We can fix this on the IA move event.

So here we can just look for IA move.

Uh, not the getai move, but the input action.

So what changed now is that this triggered is not only active if we press left or right, but this is

actually also activated if we press up or down.

And this means if we press up or down, this access value for x is going to be zero.

So inside of this update rotation we had this check of if bigger or equals than zero we look to the

right.

So if we press up or down this is going to be zero.

This is going to be triggered.

And we're going to look to the right side.

So we have to add one more branch in here to check that edge case.

So here we can just branch.

At a branch here, and we want to check that the direction does not equal zero.

Like this.

And just like this.

Right.

And here we also got to be careful with the float rounding issues.

But actually this worked out for me.

Like I don't have to check the nearly equal.

Right.

We could also put in the nearly equal.

But actually this one worked out for me in this case.

But it is something we should keep in mind with the floating point errors that are common in computers.

But for now, this is working fine.

And let's try this out.

Now, if we go here, right, I look to the left, I press down.

It is fine.

We don't flip to the other side.

And if I hold down and jump, we can slide left.

If I turn it to the right, hold down and jump, we can slide.

And if I just jump, we can jump while walking, right?

So we have not technically implemented the slide.

Of course we still want to polish it up, but we can jump, we can slide, we can turn around, we can

wall slide.

All of this is still working.

But before we start polishing up the values we use for the slide, I first want to implement the animation

because things are just easier to understand once they actually look like sliding.

So go back to the BP player and for the Aya jump, go to the Aya Jump event.

And here.

Right.

So before we start sliding, like we did for the wall slide, we want to use a boolean to save the state.

Right.

So here we just create another variable and just called this sliding or just call.

It is ground sliding to make sure there's no confusion.

And if we press the button here right.

We set this ground sliding to true.

And then we go into this animation.

And we then want to set this back to false, which is great that we have the callbacks here, right?

We don't want to do this here because this happens right away even before the force ends.

So oncomplete we want to set it to false and on fail.

We also want to set it to false.

The sliding right.

So this is just a nice way we can handle the animation through our callback events.

Now of course we also need to add this to the animation blueprint.

Go to the content drawer in the blueprints characters player.

The ABP player.

We now want to add a new state for the sliding.

So here from the idle we can go to the animation state.

And add in slide here and just open it up and here just play slide.

And for sliding there is no shooting.

We are going to prevent shooting while we are sliding.

So just play slide here.

And go back out.

And the condition here, of course, is from the idle owning player is sliding.

And I think we just have to compile and save because it doesn't know about this variable yet.

And actually it was my mistake.

It is called is ground sliding.

And this is the transitional condition here.

Right.

And we can copy this, go back out to locomotion and to go from sliding back to idle, we just do the

same thing and go here and just copy paste this in and then just use the not boolean to completely flip

it around.

And we can then just connect this here.

Right.

So we can go from idle to slide and from slide to idle.

But actually it is also very common from run actually more so common to go into the slide.

So we can also go from run into the slide.

And we can just copy these conditions.

The is ground sliding to go here and just do this.

And now you'd think that maybe we also have to go from slide to run.

But actually, like I said before, if we end the slide, it's going to go to idle and it's going to

try to go to run right away.

It's going to evaluate on the same frame.

So we're not even going to get like a single frame of idle if we are able to run.

And this is just a cleaner way.

Of course, we could also go back, but it would have the same result.

Now let's try this out.

Go into the map, hold down and jump and you can see the nice slide animation.

It is aligned correctly already, right?

Like all of this is working out nicely.

And now we can tell the slide is a little bit short.

So we might want to adjust some values to make it more useful.

But it looks cool.

It is working out.

Now back in the player.

We just want to change a couple of these values, right.

So I want to change the duration to 0.3 to make it a little bit longer and also make it stronger.

So strength of 1000.

And of course these should again be variables.

So from the strength we can just drag off promote the variable.

And it's called slide strength.

And drag out from the duration and just call it slide duration.

And just like this and test it out again.

Compile and save.

Go back in here.

And yeah.

So this is a more useful slide from a gameplay perspective.

And yet everything else still works.

And this kind of showed you how we can use a custom made plugin to use it in here.

And to overcome this like very hard problem of sliding by using the root motion that is built into Unreal

Engine.

However, you would have to install the whole gameplay ability system, which is a very complicated.

But through my plugin you just get easy access to the one node that we need.

There are still a couple of edge cases and problems with the slides.

In the next video, we're going to make some adjustments to it and improve it even further.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.