All language subtitles for lesson091

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
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
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian Download
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

Alright so we can create probably one of my favourite

Of platformers and that is just collectible coins

Tesco head in jump back into Photoshop or we could have double click on level one here this is our p.m.

Defile

Is it open in Photoshop for us

As you can see we have our ground we have a player in because it is create a coin now if you get destroyed

See where your ground is in

White background

Go ahead and select your background here and click on this lock

Allow us to actually change the background layer that came by default

With this Photoshop file

I'm just going to go to image

Adjustments

And how about just hue saturation

This allows especially just like this as well so we can just make this little prayer

Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1

Jericho

This is our background layer let's be sure it's the right name so let's call it background

And I like to put the word reference in parentheses

Well I know I'm not actually going to use this layer in the actual game but it's good to have in my Photoshop file

Presenter

Ok now let's go ahead and create a coin does using a rectangle marketo and click and hold

Tuesday elliptical marquee tool

A hold ship that's going to allow me to create

A perfect circle and I'm going to click and drag and I think that looks great

Now going to fill.in

We want this to be a white swatch

We can actually just

In Dragon 2 white

Or we can actually just click this

Invert button here

Convert are to swatches watches we have on hand currently stuff I want to Black to be

Say what time does pink and do that click ok and I get a switch between the two

Fortnite keeps winning the White

Fill.in press ctrl-d to deselect

And now we have a coin to win in that coin

And then save

How is your back into unity

And you'll see that our coin is now a sprout

Imported

Into our project folder

Here is a coin sprite

In your head in drag by in the scene

About there

It must make sure we put it in the right layer so I know that layer one is where all of my

Rounders

Best primary one of the coin as well that's drag there and put it right here

Great

Might as well make the coin a prefab

Because

Honestly we're going to be collecting a lot of coins in the scheme

So anything you're reusing over and over again

Always create a prefab

This is dragon coin the pre 50

And was go ahead in hip play and see how it looks

Awesome

Obviously I'm not collecting the coin but

And all looks pretty good

So how do we collect this coin

Create a new script in when I get a call it coin

Hexagon collectible

Why is that

When you creating a script

You want to make it as broad as possible

The reason why is you why use as little new scripts as possible

So we're gonna call it a collectible

That's because coins health emanation or keys are other collectible items

They are pretty much behave the same don't they

Just adjusting different inventory items

What we're going to do is create a new script

Make sure you select

Inside the scripts folder before you create a new c sharp script

How much is call this

Collectible

And will do is just drag the script on to a coin

You're obviously do anything because we have actually written anything but

Now we can double click

Open it up in Visual Studio

To the first thing we want to do with this

Collectible script

Is actually identify whether is a collectible item oran.mor item or

Coin item or just a

Inventory item

So what we can do is if you guys remember we have bullions rape

Wiki create a new private bullion

Navigate say is

Coin

= boss

Or just leave it at

This in by default it will be false

So that's one way of doing it so let's go ahead and do that we can have

The sea for bullying so we can have a coin we could have a health

We could have

Is

Emo

We could have

Is inventory

Adam

Ok

What is this look like inside of Unity

Let's go to a coin here

Soccer coin

What makes it not say anything

Why is that

Are you priority guest it

The reason is because these are all private variables meaning

Even private to the unity editor so we can't even see them

In our inspector

How do you solve that won't you priority guessed it we're going to do

Serialise field

Copy that and paste it on each one

Again you can do either public variables they show up in the inspector and you can edit them inside of Unity

Or

You just serialise a private

Variable

Is going to campus the same thing

So here are our

Or

Billions

So

We could be

Is coin and that means pay I'm a coin

Is health that means I'm health

Is a multimedia memo

Or is inventory item that means I'm an inventory item

So we're not going to make it this messy some of you who might understand code a little bit better than I do we'll be looking at this

Thomas there's a better way to do this and there is a make sure you in just a second when I want to drive my point home

Is allows us to have all different types of collectibles

Goddess using one script

What creates a

Way to check

And do something based on each type of item

Well we got to do is just do some if conditionals

So what we can do is

If I'm a coin

Let's say

Print to the console

I'm a coin

Ok

Well how do we write there in actual code

Yes

Is coin

Equals equals true

Or a quicker way to write this is just

If is going

Then debug.log

I'm a coin

Set alarm

And jump in unity

And let's sitar is going to true

On our coin game object

Play and see what happens

I'm a coin is immediately printed

Do they cancel because

In the start

We have this condition if is coin

Ibo.org I'm a coin

So what if I wanted to check if it's health instead of a coin

What serial code would be something like if I'm not a coin and instead

Health

Then print to the console

I'm

Not a coin I'm actually

How would we write this in actual code

Well

Yes you something called else

So if I'm not a coin then I must be

Something else so in this case let's just say I'm

Health

Say that out

So if I die select is coin and I said that false

Play

Looks like it says I'm health

That's not necessarily true is it

Just because is coin is set to false doesn't mean that it's a help collectible

The way that we would do this is actually use

Else

If

Is health

Then I'm health well we can actually just keep going down the line

Is anal

NN1 more after this and then debug.log

I'm Emma

NN1 more we actually don't need it to be else if it just beat else

So if all of these turned out to be false

Then by the fault it's just an inventory item so debug.log

I'm in inventory

Adam

Alright in what time means we actually don't even need this bullying

We can just delete that

We have three types

If all three of those types of false

Initiative generic inventory item

Save that we can get rid of this pseudocode comment here

David out

Subtitled by -♪ online-courses.club ♪- We compress knowledge for you! https://t.me/joinchat/ailxpXoW3JVjYzQ1

When was checking to see if this works but sorted out by just testing is coming so it's true

Play

Pacific debugs to the console window

Does it's great I am a coin

Someone's I deselect it and then do is hell

Nothing's getting printed to the window

Why is that just 3 sure guys remember it's happening inside of a start function

So we actually have to restart the game so let's set is coined false and an is health

Is true and then apply again

What's great

Tickets I'm health

How much is test is amo

Right

I'm Emma

What if I just

Take care off completely

Looks like I'm in inventory item

Is being printed to the console and that's exactly right

So basically are collectible script is going to allow us to do certain properties

Based on

Is bullying here

Now believe it or not there is actually a much cleaner way

To set up these three variables

Look at the inspector here

If we could magically change this inspector would be a much cleaner way to do this

I think a dropdown menu where you can only select one

Would actually be much more effective

Just be a cleaner way to do it

So what we can do is actually create a new variable type

Night necessarily a bully and although it's kind of similar to a bullying or maybe it's a combination

A brilliant is perhaps a good way to think about it

It's cold

In eNom

What the heck is an email

Have you ever confused about what a certain variable type is just Google it

In immunity

Ok let's take a look what is an Anam

Unity editor stuck on that

Looks like we have a reply here with 17 upvotes on a answers that you needed that calm

What does says my name is a keyword

That allows you to declare an enumeration is in a numeration

Innovation is a set of names for values

Example

Difficulty is easy normal in heart

Ok so maybe that's a drop down menu

Does Go-Ahead in declare this inside of r script

So we're going to comment Out All Over bullying here in the way you do that is forward slash star

Star forward slash

And now we have a different way of commenting in

Visual Studio

Just keep this just in case we need it

Anytime is a script that you might want to save but you know you don't want it actually doing anything in your current build

Just commented out like that

Does create an enum variable type

Typing eNom

Let's call it

Item type

We were going to declare this is within open bracket

And I'm going to type

Let's see where coin we have health

And then we have

I come in here so we don't go crazy

Is create an item type enum or that's a

Rock down

Ok

Not done just yet

We Created by number we actually declared the variable

So that we can see inside of the inspector

So we're going to do is type serializefield

We know we want to see it in the inspector

Private

Item type

Item type

And that's about it

I know this is a little bit confusing because we're doing it twice

I just know that this is creating the ii-nam

We also need to create a variable that uses that eNom in this case it's called Adam type with a cat

I

We have a new anam called Adam type

That we can use inside of this collectible script

Create a new item type variable and then with a lowercase I

Create a variable

Don't save this year I know that this might be confusing and sometimes you actually have the Google how you declare the

Even I forget sometimes

So if you ever forget has declare in use an enaam just Google it and you'll see the answer at the top of Google

I do it all the time most developers do this as well

Heartless jump in the unity here

Hopefully everything is working

It looks like we have some errors

Privacy errors in your console

You try and hit play

It says all compiler errors have to be fixed before you enter play mode because you nearly can actually

In anything if there's one script that's broken

Like we have a tenner bearers here 3 hours and that's kind of terrifying what's going on

What's double click

Alcohol

Actually takes us inside a Visual Studio and shows us where the errors are

The red zig zag here

That means that is coined

Well

Guess it's just not a variable y is that other over the name is coin does not exist in the current context

No that's because we actually commented out the Declaration of these variables exist anymore

I see

So but actually just comment out all of this is well just for now so we can

Take a look and see how it looks

In unity

Alright so now The Script should be able to compile

Ok great no more hours

Now we can see our collectible script here has an item type variable

And not a drop down menu

Sweet

Coin or we can choose health

Pikachu's ml

I like that

Worcester back in the Visual Studio here

And now it's think about how we could actually check

To see if we've selected coin health or ammo

In the dropdown menu

Just go ahead in uncomment this out

Instead of saying if is coin because we don't really have this bullying anymore

The way we check

What's selected in the dropdown menu is

Yes

Item type

Equals

The item type of be created here that

Coin ok cool

Rod SL safe item type

Equals equals

Item type that a look

It's suggesting that three different item types for us

Well let's see here we can double click health

Raped

One more time

If I am type

Equals equals item type dot

Emma

Awesome

Toyota thinking it is a lot of C Sharp and syntax that I'm going to have them memorise and understand

Thomas understands all his stuff and he doesn't actually need to reference anything and that's just not true guys

I promise you when I wrote this code originally had a reference things on unities website

How to Google how to declare an enum type

How to check if an email type is in your condition

Those kind of questions are always being Googled in fact I would argue Google is open all

Time on another monitor for pretty much every developer out there

Developers out there who will look at this tutorial and say if Thomas doesn't even know how to clear my number

Then he doesn't wanna make games

And it's just not true guys have made two games and release them on pretty much every platform

It's important to note that you should not be signed into not using Google Google is your friend

And honestly you don't have to memorise everything about code

Tell

What's happened to Unity here after saving

See how everything works

Looks like we have some alerts here

Mcanally worry about these you guys are get alerts all the time they're kind of just part for the course I'm in clueless

If we can address those later

Take a look at our drop down menu here

Great surveyselect MOT and I have play it should show up in the console window

I'm emo

Sweet

Looks like we're able to check what item types are in the drop down menu

And then do something based on their condition

That's exactly what we want to do some really cool

Ok we'll go ahead and get rid of this comment without portion Here We Don't Need That Anymore

Save it

So we have a basic script written

Are collectible

How we actually touch

Collectible

Are we detected two players even near the collectible in touching it

When we gonna do there's use a simple box Collider

Peter you sorted your coin

A quick add component

Can adults get a sprite renderer

We have a collectible script on top of it

Banana box Collider

Be sure you select box Collider 2D

And not the regular box Collider

Regular box Collider is for 3D games and it's going to have a collision in the z-axis as well

City of box Collider 2D

Square head in zoom in here

Take a look at what's going on

No it's now we have a green box around

It's actually a box Collider

We can scale it up

The extraction scale in the Y Direction

Actually make it a little bit bigger than the coin

Play match on 61

Alex Grey

Play

Swan

Should be able to actually stop when you touch

Well what's happening is

Is a Collider

Colliding with the coin

The way that you avoid this is actually just said it is Trigger

Now we can walk through the coin but still detect

If the player is touching the coin

Play mode here

Anfisa is Trigger is that a true

We definitely want this to be true across the board for all coins

Just go ahead and say is Trigger too true

Are coin here

And

Then we're going to need to actually create a script

Check to see if we actually touched

Coin

Are we definitely don't need to create a new script because we have a collectible script here we just need to create some more funk

That's a text whether we touched that coin

Double click on collectible here or just go back into Visual Studio

Create a new function

Actually a function that we can just go ahead and use right out of the box with unity

So

Is called ontriggerenter2d

Never forget what is this guy's just Google trigger 2D unity and it'll probably show up

The top of Google

It's void

On trigger enter or there is ontriggerenter2d not on trigger enter that's for

Really just ontriggerenter2d and that's going to ignore the z-axis

When heading created on trigger 2D function for us

What is this mean

What's 9 Saudi update so you know he's not gonna be running what's inside of this function

All the time

Is actually going to only run this when something triggers with this

Specifically when something with a Collider and rigidbody

And that's our player

Collide with this project

Telescope debug.log

I'm touching something

Save it out

Let's go back in the unity and looks like there's no airs that's good

We don't need a drag collectible anywhere because it's already attached

Drag queen

The code we just made

Is actually ready to go

Does it play

Ok I'm Emma appeared in the console that's good

Still there now script

Touch the coin

Right

Awesome it is I'm touching something that is how it doesn't consistently print something into the console

Why happens when I enter

Collision area

Take a look at the collision area there is a US small green box in the same window here

The moment we touch that

Perfect

There's a little problem actually here

What if I had a box so let's take this just for example

What's pasty in make it look like a box

I had a box

Also had a rigidbody2d and again original body is what makes the object actual used

If I had this box

Right here

Play

And I moved is coming over

You see that also interacting with the box

We really don't want that because

Checking if it's touching something

It's going to be collected we are not boxes collecting things

How do we actually check to see if only the player

Is touching the Queen

Taxi really simple

Which is going to put a condition

Inside of a function

Was John back in the Visual Studio here

Open up a script collectible that CS

You must create a condition

Inside of her on trigger enter 2D function

Just gonna go something like this

If the player

Is touching

Me

Print

Collect

In the console

What's this device year

Write this condition out

The way we write this is actually we would use the variable that's included

In the parameters this parentheses is the parameters section of the function that doesn't

Make sense soon we're gonna use this a lot

What are the parameters included in the ontriggerenter2d is the collision or the collider2d

Basically this allows us to know certain information about the collider that's touching the Collector

So what we would write is if

Collision

That's the variable name here lies a very curious of something a variable just look for the lowercase letter

If collision dot

Game object name

Equals equals

Player

Then we're going to do something right

Debug.log collect

Looks like we forgot her

Close princess is here

Erika

Analitik play

And see what happens

Looks like if I jump up on the platform here and when the right like collect is being fired

Perfect

Alright let's check and see if this box

Dear

Will do the same thing we definitely got one at 2 but that's check

Good looks like nothing's happening even if I clear the console window

Not interacting with the coin that's perfect

Alright

Really quick

What is the white the

Coin to disappear

Emily white

A new player script to actually add a coin to its inventory

It's actually really simple

Are we going to do with type game object in lowercase game object is actually just a reference that

The news for the actual game object that contains the Script

Turn this case

A coin

That said active

To force

Set the parent object so that's the coin in any children inside of the Queen Sofia

What goes inside a bitcoin or maybe some players are some gloves disabled as well or dry

What is a better word meaning of the word deactivated

Not disabled or enabled

Because enabled in disabled or referencing

Enabling in disabling scripts this is enabling and disabling

The polygon Collider

Is disabling and enabling the sprite renderer

This is deactivating the game object the other gameobject is now

Dawn

Open the actual scene

And it's also faded out your dad's deactivating so you can have to memorise activating

Is related to this toggle here which deactivates a gameobject entirely

Includes stopping all of the scripts associated with it

So think about this is pulling the power plug

For your actual game objects I want to deactivate this coin

I'm pulling the power plug to the entire thing I must destroy it entirely

All of the scripts the spray render at the box Collider at the collectible clothes off stop

Disabling the collectible script

Just stop the Script by the renderer for the Sprite will still be there the game object is still running

Ask later is still there we just disabling The Script

So when I deactivate

The entire game object

The way you do that is gameobject set active

Go ahead and hit play

See if that actually does what we need it to

The moment we touched the coin it should just disappear

Jump

Regardless of the Queen

Awesome

Another way of achieving a similar effect is actually just destroying the object

So we can pull the power plug or deactivate the object or we can just destroy it entirely

Does comment out this line

Actually just destroyed the game and you can see what happens

Destroy

What game effect

Really quick guys any time you see something inside of a printer sees when were calling or doing a function like

Destroy

That's called the parameters

Cell parameters are passed through functions so in this case

Inside of the Destroy function which is a function we can use inside of any game object

There are actually two parameters inside of the Destroy function

What do you want to destroy that's the game object but if you press the comma key

You can actually see right here can you give us a hint

Float

T

Does that mean that means well how many seconds do we want to wait

To destroy

We can do 0 f or just remove it entirely

Is going to destroy the gameobject immediately

To see how this looks

Go ahead Nick play

Well unsurprisingly

Identical

But you can see it's been removed entirely

Hierarchy here

Was coins like that actually I'm ok with destroying the coin

Everything is once we exit play mode it's not actually destroying it permanently it's just destroying it in play mode

Can I see ok with that I'm fine destroying the coin because I know we never going to be able to collect a coin again

When were playing this game

That's fine we can keep destroy that came object remove this comment here

There we go save it out just know you disable components and scripts you can deactivate

Object that is pulling the power plug

Or we can destroy gameobject entirely and destroys everything associated with them

Game object to transform the components the scripts running on it

Everything we talking about parameters during this course so don't worry too much if it doesn't make sense

Ok so what if we wanted the player to actually collect this coin

Where would a coin go if we just destroy the coin

Where is a girl

What everything in video games guys it's stored in simple variables

Directly going anywhere it's like the Queen is going into this game objects pocket as I was going

Not even going to a UI element inside a move to a UI element

All we want to do is tell the player

That we have a coin that's all we need to know we need to know how many coins is a player have

That's the most important thing

Then we can make graphics for the screen lighter that reflect how many coins we have

So all we need to do is increase the coin amount the player has

I want

The way we do that is not inside of a collectible script just yet

Yes you need to create a new variable inside of new player

What's double click new player here

Create a new variable called private integer because you can only get pieces of coins

Play this is going to be the one going to coins a million coins etc

Private ENT coins

Coins collected

And by default it's going to be 0 so we don't need to actually write that out

Semicolon

Now we have a new variable called coins collected

Great

Now if we're going to a collectible script here

Before we destroy the coin when we collect it we need to make sure we increase the players coin and

The way we do there is through the game object that find command

And then also gameobject at getcomponent command

This is probably some of the weirdest syntax you can be using

When you're writing c-sharp scripts

And this was one that I certainly had memorise

So don't get overwhelmed we going to do this a lot when we're creating a game

So just practise riding with script because you're going to be using this a lot inside of Unity

So to find the player we go game object that find

Player so it's going to look for a game object called player

Do you know if he's going to look around going to get a magnifying glass is that looking around in the scene really quickly

Or a game object card player

If I find one

Is going to look for a component

Gameobject get component

And another way of putting this is going to look for a script that's currently running

Look for the new player script

Sky News

Less than and greater than sign here and we're going to do new player

And then to parentheses I know it's weird but that's just the same tax

Diet

Was it called

Coins

Elected

Equals 1

So that's how we actually look for a game object and then we look for the component associated with it

Which is new player

Which again that's where are coins collected very Berlin

Variable is not inside of the game object

Is the side of the component

On the game object take a look at unity here we'll get an error thrown don't worry about it

What's like a player here

Serious

There's a new player script

On the player game object this is the game object the name player

Air player

There's a component or a script again component in script are pretty much synonymous

Is a new player script on here

Inside of the new player script there is a variable called coins collected

So this gameobject define player.get component

That coins collected is just a way for us to slowly trail into

The Script

I'm looking see ok is there a coin collector variable

If there is set it to 1

Ok

Now

I know that there might be a little bit confusing to trust me we're going to be using this or what

So if you feel overwhelmed right now just type this out in we're going to keep practising it's going to become s

Promise don't get overwhelmed

I'm looking for the player

I'm looking for the component you player

And then we're looking for a variable called coins collected

What is a problem here

When collected has a red zigzag and why is that

Well it's actually inaccessible due to its protection level

That means that it's private

That's my private and public variable are that didn't make sense in the earlier sections of this course

It's private meaning I can access it inside of new player so I could type

Coins

Collected = 200 rate

I could do that all day long I wanted to

Because I'm inside of a new player script in me

And this script is

Changing this variable that's because it's private means I can only do it instead of The Script

So this is an instance where we go look we have to be public

The coins collected is a public variable

Meaning other scripts can access it

Delete this

Now

Exec is gone

That means we can set coins collected one the moment we collect this coin

The lift test for sale

Play here

And run

And then jump

First off

Where we collect a coin

Let's see how many coins we have

We have 0 over here

In the new player

Campania

I ran over

Looks like coin collecting is one

Awesome that's great so now we have

A coin

Don't go heading copy and paste this coin all over the place in start collecting coins

Let's be careful though

We actually go inside of this prefab and take a look at it

What is the prefab only has a Sprite renderer attached to it

Where did everything go

Well

What we've added to this coin

Are additional features that are necessarily at the root level of the prefab

Is there a digital features

With added

How do we apply them to the prefab so that this prefab is identical across the game

When we duplicate

The way we do that is we can either

Add each one individually inside of the prefab here and edit the route prefab so we could add a 4

Collider we could add the collectible script

Is a better way to do that

Go back into a scene here

I'm here

Allow us to apply all of the changes to this prefab

To the original route prefab coin

Anyway be careful doing this is a basically like saving over a document

When you're actually working in Microsoft Word or Photoshop or something this is basically saving over a prefab

Well we don't have any other coins in a game without been using anywhere else

Go ahead and hit apply

Now when we drag the coin prefab into the game

Has all of the same properties

Including the box Collider in The Script on it

The other coin has

That looks great

Let's be sure we keep things clean and going to be tempted to just create a game guys and that actually clean up

So what you want to do is actually drag this down but put it next to the other coin

In hierarchy

Just so everything is nice and organised

Sweet so now we have all these coins so I had hit play here

Insert collecting coins

That's great so we've collected 12

Masham

345

Let's take a look at our player here and make sure he's collected 5 coins

Does collapse all the players here just click on player here

Looks like we still only have one coin

What's going on

What the reason that is is because we just set the variable

1

We need iterator

30 plus equals

1

Anything goes when I go to use time that deltatime remember that for like counters and moving

Update

Just collecting integer

Plus equals one is fine

Because it's ontriggerenter meaning with touched it once with entered into the box Collider

It's only going to do it once that's fine

We don't need time to time here

Not again guys + = 1 is the same as riding this

Find player that get component new player that coins collected equals gameobject that's fine

Ms carpets

Is the same thing is equal in itself plus 1

So if itself equals 2 is going to add

Plus 1

So if coin collected equals to

What is going to say collected = coins collected + 1

Then it turns 23

Then the next time you got to go in it will take me 3 so it's going to equal 3 + 1 which is or

A quicker way to write this is just plus equals

That's all that is

And now we're going to either way up one when we actually collect the collectible

Ok

Set alarm

Soccer player so we can watch it

Ways to test guys you can have either your coins getting printed to the console or you can just look at

You see realised or public variables

In the inspector over here

We have one coin

No I had to Great

Now we have three looks like it's working awesome so now we can collect coins in a game

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