Afrikaans
Akan
Albanian
Amharic
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
Russian
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
In this challenge review we're going to take a look at player rapping.
So here's our pseudocode.
And in order to do this properly I need to run our application and I need to know when exactly do we
need to rap.
So with the player selected in the hierarchy so they can see the detailed information in the inspector
we're simply going to move all the way to the right.
And as soon as I'm off the screen which is about eleven let's go on set to eleven.
You can see a tad bit of me so I'm gonna set it to about eleven point four and that's two point two
three.
OK so on eleven point three.
So if I move past eleven point three if I'm greater than eleven point three I need to appear at negative
eleven point three.
And likewise if I'm less than negative eleven point three I need to appear at positive eleven point
three.
So now that they have the value that I need to check against.
Let's go ahead and write our if statements.
So I'm going to convert this pseudocode into actual code.
We're gonna have an if statement and I'm just going to check if the transform on The X so transform
dot position dot x is greater than eleven point three f and if it is greater than one point three f
what are we going to do.
I need to take the current position in teleport him I need to say transform not position equals a new
vector 3 the x axis is going to be negative eleven point three f followed by what for the Y I don't
want it to be zero.
It has to be whatever the current Y is I don't care what the Y is it's whatever the current Y is when
the players wrapping.
So we need to say transform dot position dot y to get the current value and then zero for Z inside of
our l safe statement here we need to say elusive if we're gonna check for the left direction transformed
up position x is less than negative eleven point three f then what needs to happen we need to grab our
current position and assign it a new position to a positive eleven point three f for the X transformed
our position dot y for the current Y in 0 4 Z by saving this and hopping back into unity
you'll see here that if we run the game we should be pretty okay let's go ahead here make sure our bounds
restraints are still working and looks like we're good and if I move all the way to the right here we
wrap on the left and if I move all the way to the left we wrap on the right and there we go we have
our fully functional player controller I'll see you guys in the next video.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.