All language subtitles for 74. Fixing an Enemy Spawning Bug

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
en English
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
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
fa Persian
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

Before we wrap up the course there is one final bug to address and that is that

Enemies can get stuck in the wall

As you say

Right here

And this happens under a verb

Specific Circumstance which I will describe

Now

So let's go to our handy paint and let's

Draw a line that rep

Against the wall and if you recall

The way that we

Spon End

Is that we take the player position which is let's a right

Who's the player

And we basically shark

A vector

Along some Direction

To see if there is a collision

Edit there isn't a collision

Respond

Enemy

What happens if h

Raycast

Ends one pixel before the wall likes

And doesn't register a collision we say oh

Well then that means that there is no collision in so what we're going to do

An enemy

So we spawn the end

Play here

However

The enemy is now on top of the wall and

Subtitled by online-courses.club We compress knowledge for you!

Remember the enemy has a collision shape which is like a circle

Are the enemy ends up with a circle Collider

That is halfway inside of a wall

So the fix for this is really simple instead of checking the exact distance along which we

How to spawn the end

We're actually going to add

An additional 20 years so pixel check

Like so

So that means that if it's whole range if this whole

Line

Does not contain a collision

Then we'll go ahead and spawn the enemy

The tip

The Orange

Desired

Sponge

So essentially just adding an extra 20 years ago pics

Checking to the

The array

So that we can be guaranteed that there will be at least 20 pixels of distance between

Responding the enemy

Between the

So let's go ahead and open up our enemy manager

And implement exactly that fix so go ahead and open up the screw

And basically and hear what we've got going on is we are setting the enemy spawn position

To the player global position plus that random Direction

Choosing

Up here

X the spawn radius

And like I showed in the drawing we basically want to

Something

20 additional pixels

To the Ray

Checking

And so what we're going to do for that

Is were going to create a new variable called additional

And we're just going to random Direction

Times 2

And then in this line we were constructing the physics re query parameter

We just simply going to add that additional check offset to the second

So it's going to be spawn position Plus

Additional

Check

Off

So what does essentially going to do is that's going to create a rave and the player position

To the spawn position that we want to have for the enemy

But Plus

An additional 20 pixel

In the same direction

And as long as that raycast does not return a collision result

Then we can spawn em

So you can run the game to test it's going to be very difficult to test

But

If you play the game a little bit more you should notice that it stops

Happening

And enemies are still spawning like normal

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