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
Let's look now at the enemy's tank mover system.
This system is responsible for moving the tank across a list of steps they are provided in the 3D space.
So they are vector three, then the tank mover cycles for every single one of them and moves the tank
accordingly.
Let's find out how this system works.
First, we need to initialize this.
And as the enemy actually has the speed, we do need to provide the speed at the initial step.
And then we get the tank, which is the kinematic body and also the tank mesh.
We will need them both for our next steps.
The main functionalities that are called In the Tank Move are the following Start Move, which takes
the list of steps and also initializes the index of the whole path to zero reset, which stops any movement
that is currently happening, and also a query that will say true or false, either if the path is finished
or not.
Basically if it's moving or not.
So the actual movement happens in the physics process first.
If we don't have a path and if it's known, then we don't actually care.
But if we do have a path, we of course need to check the index.
So if the current position is not the final one, and if it's not the final one, then it means that
we have to go to that particular one thing to compute the direction.
So in order to do this, we take the 3D position that was specified at the PATH Index position and subtract
the value of the tank's position.
This will give us the direction vector or the vector that is headed from the tank to that particular
position.
If the length of that the action vector is below one, then that means the position was reached and
we need to increase the index.
If it's bigger than one, then this means we haven't reached yet the position.
So we need to apply a translation and of course you need to normalize the direction because the direction
would be the whole vector from the tank to the new position.
By normalizing it we take a vector of length one but the same orientation and we multiply it with the
move speed that we use in initialize and also with the delta between frames.
So we make sure that it's frame rate independent next.
This handles the actual movement, but what about the rotation?
We will use the tank mesh as we don't want actually to rotate the kinematic body, we'll just rotate
the 3D mesh.
So what we do will make it look at at the next path, which is the path we're actually heading towards.
Of course, we need to also reset the rotations that we don't need.
This is to prevent the case when the tank gets closer to the position and the position actually gets
below it, kind of.
So it might be that if we look at and we don't reset the X and Z rotation, the tank will look actually
down and it will look strange.
So make sure that this is in place.
Of course, if you have terrain that's not flat, then you might need to change this.
But I would rather go for a different result.
Let's say Iraq last and check the terrain below and check the normal there.
That's the other way to do it.
And if the path index has reached the final position, then we omit the signal on finished moving.
This will inform any particular objects that are on.
Subscribe to this notification to make sure that other functionalities are played.
For example, if the enemy has reached the destination of a waypoint, then we need to make sure that
we need to go to the next one and so on and so forth.
So basically this is how the tank I moves, by the way.
This is just the movement functionality.
The other part of the movement functionality is using the nav mesh to actually generate the path that's
being provided here.
So this just moves the tank, but you'll see later on how we can also use the nav mesh to generate the
path.
I hope you enjoyed this and see you in the next one.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.