WEBVTT

00:00.040 --> 00:02.520
Let's make some collectible items.

00:02.520 --> 00:05.440
So I have some, uh, some fruits.

00:05.440 --> 00:06.560
You can simply say.

00:06.760 --> 00:14.040
So for that, I'm gonna move over to my project tab assets and then pixel, sprite, uh, sprites folder.

00:14.240 --> 00:21.280
Then I'm gonna move over to my Pixel Adventure one folder, then items, and we can see we have checkpoint

00:21.280 --> 00:26.360
and we have some fruits, uh, over here inside this fruits folder.

00:26.360 --> 00:28.800
So we can we have strawberry.

00:29.000 --> 00:30.520
We have pineapple.

00:30.800 --> 00:31.480
All of these.

00:31.480 --> 00:33.520
You can choose any of this.

00:33.520 --> 00:38.200
I will have a, uh I will have them in resources.

00:38.200 --> 00:39.760
You can just download those.

00:40.000 --> 00:41.920
So I'm gonna choose Apple for this.

00:41.920 --> 00:43.840
So I'm going to select this apple.

00:43.840 --> 00:44.960
So let's select that.

00:45.000 --> 00:46.080
Go over to Inspector.

00:46.080 --> 00:48.640
Let's click on this open Sprite editor.

00:48.640 --> 00:51.000
So we need to slice individually.

00:51.240 --> 00:56.360
So we're gonna choose multiple sprite mode to multiple and pixel per unit.

00:56.400 --> 01:01.970
Let's do something like 16 and filter mode to point of filter to get rid of blurry.

01:02.010 --> 01:05.170
And let's click on this apply button in the bottom right.

01:05.490 --> 01:09.730
And instead of slicing automatic we're gonna slice grid by cell count.

01:09.730 --> 01:11.090
And it's gonna be fine.

01:11.090 --> 01:11.930
So that's why.

01:14.890 --> 01:15.730
So just wait.

01:15.770 --> 01:16.770
Now it's done.

01:17.050 --> 01:19.250
So let's go over to Sprite Editor tab.

01:19.250 --> 01:20.530
Let's click on this slice.

01:20.530 --> 01:23.050
Let's select automatic to create by cell count.

01:23.050 --> 01:29.170
And let's count how many columns and rows we have 1369

01:30.050 --> 01:38.690
1215 1715, 17 I guess let's put 17 columns and one row.

01:38.730 --> 01:41.250
Let's click on this slice and then apply.

01:41.650 --> 01:42.690
Now it's fine.

01:42.850 --> 01:44.330
Let's select the game view.

01:44.330 --> 01:48.450
And let's click on this arrow in order to see the individual sprites.

01:48.450 --> 01:49.850
So I'm going to select the first one.

01:49.850 --> 01:53.410
Let's drag it over to the scene view or into this hierarchy.

01:53.850 --> 02:00.300
As soon as we drag it we can see it's pretty much small, so we need to make it a little bit bigger.

02:00.300 --> 02:02.700
So we're going to select the sprite sheet one more time.

02:02.860 --> 02:08.580
And let's make this pixel per unit less number to make it uh the sprite size bigger.

02:08.980 --> 02:10.980
So we're going to do it something like 12.

02:10.980 --> 02:13.300
And let's click on this apply button.

02:14.060 --> 02:16.580
And I guess 12 seems pretty much fine.

02:16.580 --> 02:23.620
But we can go ahead and let's make it ten instead of 12 to make it a little bit bigger and noticeable.

02:23.780 --> 02:25.580
So I'm gonna do ten.

02:25.900 --> 02:27.340
Let's click on this apply.

02:27.380 --> 02:29.340
Now ten is pretty much fine.

02:29.620 --> 02:31.820
And let's select the game object in the hierarchy.

02:31.820 --> 02:34.100
Let's drag it in the top so we can see.

02:34.260 --> 02:37.100
And let's rename that to something like Apple.

02:38.020 --> 02:39.140
Uh Apple.

02:39.300 --> 02:40.700
So let's call it Apple.

02:40.820 --> 02:47.820
Or we can simply call it uh icon something like Apple icon because uh, we just want to, uh, make

02:47.860 --> 02:52.020
uh, two animation clip of this once we're gonna collect this apple.

02:52.340 --> 02:57.940
Uh, we just gonna make an animation like it's gonna go up, and over time, it's gonna fade out.

02:57.940 --> 03:00.140
So we're gonna have to animation.

03:00.140 --> 03:05.100
So that's why we're gonna create an empty parent game object first, and then we're going to make this

03:05.140 --> 03:11.260
apple a child of that game object, or else our animation just gonna be weird.

03:11.260 --> 03:12.140
So that's why.

03:12.460 --> 03:15.020
So we're going to select our Apple in the hierarchy.

03:15.060 --> 03:17.620
Let's call this one Apple icon.

03:17.860 --> 03:20.780
So we're going to call it Apple icon.

03:21.540 --> 03:24.700
And now let's create an Apple Game object.

03:24.700 --> 03:27.060
Uh basically we're gonna make that one parent.

03:27.060 --> 03:29.940
So for it we're going to move over to our hierarchy.

03:29.940 --> 03:32.020
Right click or hit this plus icon.

03:32.020 --> 03:35.660
Then create an empty parent game object sorry empty game object.

03:35.660 --> 03:38.860
And we can call this game object to something like Apple.

03:39.180 --> 03:41.020
And now what we're going to do sorry.

03:41.380 --> 03:43.700
It should be Apple okay.

03:43.740 --> 03:45.140
So it's pretty much fine.

03:45.300 --> 03:51.020
Now we're going to take our Apple icon and let's drag it on top of this Apple GameObject in the hierarchy.

03:51.020 --> 03:56.230
In order to make our Apple icon child of this Apple game object.

03:56.230 --> 04:02.630
So if I select our Apple, uh, make sure you select your apple, then go over to uh sorry Apple icon.

04:02.630 --> 04:06.310
Then go over to Inspector Transform and right click and reset.

04:06.310 --> 04:09.270
So gonna reset the position with our Apple.

04:09.430 --> 04:15.470
So if we select our Apple GameObject in the hierarchy then select this move tool in the scene view.

04:15.710 --> 04:22.110
If we move our Apple game object, we can notice that our Apple icon is also moving with it.

04:22.150 --> 04:22.590
Why?

04:22.750 --> 04:26.670
Because Apple Icon is a child of this Apple game object.

04:26.870 --> 04:29.030
Now we're gonna take our Apple game object.

04:29.030 --> 04:32.110
Let's drag it in the top so we can see all the time.

04:32.510 --> 04:35.430
And now we are ready to make our animation.

04:35.670 --> 04:40.670
But before we make animation, let's add some components to this Apple game object.

04:41.070 --> 04:43.190
So firstly we're going to take the take.

04:43.350 --> 04:48.910
We're going to take it something tag it something like apple uh or collectible items.

04:48.910 --> 04:51.470
So let's add tag with Apple instead.

04:51.470 --> 04:52.550
So we're gonna select that.

04:52.550 --> 04:54.240
Let's go over to Inspector.

04:54.440 --> 04:57.320
Make sure you select the parent one, not the child one.

04:57.360 --> 05:00.520
Inside this child one, we're going to create the animation.

05:00.520 --> 05:05.160
And in inside this parent game object we're going to add those components.

05:05.160 --> 05:06.960
So we're going to select our Apple.

05:07.000 --> 05:08.920
Let's go over to Inspector Tag.

05:08.960 --> 05:10.720
As you can see it says untagged.

05:10.720 --> 05:11.800
So let's click there.

05:11.840 --> 05:13.360
Let's click on Add Tag.

05:13.480 --> 05:16.240
And we're going to create a new tag for this apple.

05:16.240 --> 05:18.000
So let's click on this plus icon.

05:18.240 --> 05:22.280
And we're going to name the tag something like Apple Apple.

05:22.280 --> 05:23.720
And let's click on save.

05:23.880 --> 05:27.760
And we're going to choose our apple sorry Apple.

05:27.760 --> 05:32.080
And then go over to Inspector and make sure you just tag it as Apple.

05:32.120 --> 05:37.960
Now as you can notice we just assign it this Apple game object as a Apple tag.

05:38.120 --> 05:40.120
And now we're going to add a component.

05:40.120 --> 05:43.240
So first thing I'm going to add a rigid body 2D.

05:43.480 --> 05:45.160
And we're going to set it to kinematic.

05:45.160 --> 05:47.600
So it's not going to fall down at all.

05:47.600 --> 05:52.650
So let's click on this add component and make sure you do it in inside.

05:53.050 --> 05:58.010
Basically do it inside an object, not the child one inside our child one.

05:58.010 --> 05:59.610
We're just going to make the animation.

05:59.610 --> 06:00.450
So that's why.

06:00.930 --> 06:04.010
So we're going to add a circle collider 2D.

06:04.010 --> 06:05.370
So let's add that up.

06:05.610 --> 06:10.010
You can add any collider but make sure it just fits perfectly perfectly.

06:10.010 --> 06:10.810
So that's why.

06:11.170 --> 06:15.370
And we're gonna are we gonna make the circle a little bit bigger.

06:15.570 --> 06:18.610
So let's move over to our circle Collider 2D.

06:19.490 --> 06:20.050
Sorry.

06:20.250 --> 06:21.770
So what we're gonna do now?

06:21.970 --> 06:28.370
Basically let's go over to Circle Collider 2D, and we're going to check this trigger a trigger to true.

06:28.370 --> 06:29.850
Basically we're gonna check that.

06:29.850 --> 06:32.250
So it's gonna check with trigger.

06:32.410 --> 06:36.690
And it's not gonna register our player to pass through it.

06:36.690 --> 06:41.290
So that's why we just check this trigger to true basically checked.

06:41.330 --> 06:44.450
And now we're gonna add a rigid body to the component.

06:44.450 --> 06:46.970
And we'll and we will set that to kinematic.

06:46.970 --> 06:49.730
So it's not gonna fall down due to our gravity.

06:49.890 --> 06:54.890
So let's click on this add component and let's find Rigidbody 2D by typing.

06:54.930 --> 06:56.410
And let's attach that.

06:56.410 --> 06:58.650
And let's set the body type to kinematic.

06:58.650 --> 07:01.490
So we're going to move over to rigidbody 2D component.

07:01.730 --> 07:04.930
And let's select this body type to kinematic.

07:05.210 --> 07:06.290
So now it's fine.

07:06.290 --> 07:11.970
And collision detection we're going to choose continuous and interpolate to interpolate to making out

07:12.050 --> 07:12.610
smooth.

07:12.730 --> 07:14.450
And now that's fine.

07:14.450 --> 07:16.050
And as you can notice.

07:16.330 --> 07:18.210
And now let's make the animation.

07:18.210 --> 07:21.770
And we're going to make the animation inside this style game object.

07:21.770 --> 07:24.810
So that's why we just created our parent game object.

07:24.810 --> 07:27.050
So the animation not going to be weird.

07:27.050 --> 07:27.890
So that's why.

07:28.210 --> 07:33.210
And inside this Apple icon we just want to make the animation.

07:33.210 --> 07:39.970
To do that we will head over to our project app assets and then sprites folder then fruits folder.

07:40.090 --> 07:42.290
As you can see we have all of this.

07:42.290 --> 07:49.140
So we're going to select from start to the end all of these individual sprite and then drag it over

07:49.140 --> 07:52.460
to top of this Apple icon GameObject in the hierarchy.

07:52.580 --> 07:56.740
Make sure you do it inside this now child, not the parent.

07:56.780 --> 07:57.620
Uh, width.

07:57.860 --> 08:00.100
So we need to place the animation.

08:00.100 --> 08:02.780
So we will go to assets first.

08:02.940 --> 08:03.900
So we will.

08:03.940 --> 08:04.420
Sorry.

08:05.940 --> 08:12.580
Uh, so firstly we will move over to our just really a bit sorry.

08:13.420 --> 08:21.060
So we will go to assets first and then animation and then, uh, other animation.

08:21.580 --> 08:28.900
Let's create a new sub folder for our, uh, this collectible items so we can call that items folder.

08:28.900 --> 08:32.340
So let's right click then new folder.

08:32.340 --> 08:40.660
And let's call this folder to something like item item item underscore animation animation something

08:40.660 --> 08:41.460
like that.

08:41.500 --> 08:44.220
And let's open up this folder by double clicking.

08:44.220 --> 08:46.260
And we have to name the animation.

08:46.500 --> 08:53.430
And we're gonna to name this animation to something like fruit, uh, fruit idol or Apple Idol.

08:53.470 --> 08:56.390
Let's call it apple underscore idol.

08:56.750 --> 08:58.350
And let's click on that save.

08:58.670 --> 09:05.030
And now if we go ahead and select this animator tab and select this Apple icon game object underneath

09:05.030 --> 09:11.190
our Apple GameObject in the hierarchy, and move over to animation tab and then click on this play button.

09:11.190 --> 09:13.950
As you can see, it's playing the animation clip.

09:14.110 --> 09:18.630
But the problem is that animation seems a lot, uh, too much.

09:18.790 --> 09:23.670
You can simply say, uh, it's kind of, uh, seems like slow.

09:23.670 --> 09:27.350
So we're gonna increase that up with our script.

09:27.350 --> 09:30.430
So we're going to create a script, a Apple script for it.

09:31.350 --> 09:37.430
Uh, so what we will do, uh, we're going to move over to our project app, and then we're gonna do

09:37.430 --> 09:37.630
that.

09:37.630 --> 09:43.510
But before we do, let's create our collectible animation clip because we're gonna have two animation,

09:43.510 --> 09:50.200
which, as you've seen, this is our, uh, Apple idol and another animation clip just gonna be our

09:50.200 --> 09:56.000
apple collected basically means our apple just gonna go up in the right direction, and over time,

09:56.000 --> 09:57.560
it's gonna fade out.

09:57.600 --> 10:03.760
To do that, we're gonna move over to our animation tab and let's click on this, uh, click over here

10:03.760 --> 10:05.920
and then click on this Create New clip.

10:06.040 --> 10:08.880
And we have to name the clip what we want to name it.

10:08.880 --> 10:16.200
So I'm going to call it something like Apple underscore collected like that uh collected.

10:16.240 --> 10:21.080
And let's click on the save button in order to create the animation.

10:21.080 --> 10:25.120
And we're gonna move over to something like, uh, two seconds.

10:25.240 --> 10:29.840
Uh, something over here, um, uh, 120 frames, something like that.

10:30.280 --> 10:35.440
And, uh, make sure you click on this red button to capture the animation, else it's not going to

10:35.480 --> 10:35.800
work.

10:35.960 --> 10:39.600
And also make sure you select the child one, not the parent one.

10:39.600 --> 10:45.970
So now what we're gonna do, we're gonna drag it up and we will go to a sprite renderer component in

10:45.970 --> 10:52.290
the inspector, then color click there and in the bottom you will see a and just set it to zero.

10:52.450 --> 10:55.490
So what time it's going to fade out as you can notice.

10:55.490 --> 10:58.730
So if we just go ahead and then click on this play button.

10:58.730 --> 11:02.890
As you can see indeed our apple is just going up.

11:02.890 --> 11:05.010
And over time it's just spinning out.

11:05.170 --> 11:11.650
And once you satisfy make sure you just click on this red button in order to capture the animation.

11:11.650 --> 11:17.210
And if you just leave it like that, it's automatically just going to capture the animation clip.

11:17.610 --> 11:20.850
And now we're going to create a script for our idle.

11:20.970 --> 11:26.010
So if we choose, we just want to make our animation a little bit fast.

11:26.010 --> 11:28.010
So let's create a script for it.

11:28.010 --> 11:32.250
So we will go over to our project tab assets and then script folder.

11:32.250 --> 11:36.730
Let's right click then create and then Monobehaviour script.

11:36.770 --> 11:39.690
And we can name that script to something like Apple.

11:39.970 --> 11:47.810
So Apple or collectible let's call it instead Apple I guess I am spelling it correct or I don't know.

11:47.810 --> 11:50.010
So let's let's do that.

11:50.010 --> 11:51.410
And we hit enter.

11:51.410 --> 11:55.170
And we're going to open up this script by double clicking on it.

11:55.530 --> 12:05.290
And we're going to attach this script to our Apple game object and and make and our animation is sitting

12:05.290 --> 12:11.570
on basically the animator component is sitting on uh, into this uh, Apple icon tile game object.

12:11.730 --> 12:18.090
So what we need, we need a reference to that animator component of this Apple icon, because we created

12:18.090 --> 12:20.210
the clips inside this Apple icon.

12:20.210 --> 12:21.050
So that's why.

12:21.170 --> 12:27.130
So we need a reference of this animator component inside this Apple icon.

12:27.130 --> 12:29.930
And after that we can just do the animation.

12:29.930 --> 12:31.810
So just wait a little moment.

12:31.810 --> 12:36.090
And once it's done we can just go ahead and we can do that.

12:36.090 --> 12:37.290
So just wait a moment.

12:38.130 --> 12:43.380
And if I select my apple icon And the inspector in the hierarchy.

12:43.420 --> 12:44.860
Then go over to Inspector.

12:44.900 --> 12:51.620
As you can notice, the animator component is sitting on inside this Apple icon child game object.

12:51.620 --> 12:55.620
So we need a reference of this animator component to do that.

12:55.620 --> 12:56.940
Let's go to top up.

12:57.140 --> 13:00.820
So let's move over to script and let's go to the top of our class.

13:00.820 --> 13:02.580
And let's make a serialized film.

13:02.740 --> 13:06.700
Serialized field sorry serialized field.

13:07.300 --> 13:09.460
Private private.

13:09.460 --> 13:12.340
And the component we're looking for is animator.

13:12.340 --> 13:14.300
So we're going to type this animator.

13:14.500 --> 13:17.460
And we can call this one something like animator.

13:17.460 --> 13:19.540
And let's close that up with semicolon.

13:19.660 --> 13:22.580
And we're going to press down Ctrl S to save our script.

13:22.580 --> 13:24.460
And now let's move over to unity.

13:24.940 --> 13:33.940
And underneath our Apple script we will able to notice a animator component just going to pop up a underneath

13:33.940 --> 13:35.460
our Apple script.

13:35.460 --> 13:41.430
So what we need to do, we need to drag this Apple icon GameObject into that slot because the animator

13:41.430 --> 13:45.470
component is sitting on inside this Apple icon game object.

13:45.470 --> 13:48.150
So if I select my Apple GameObject in the hierarchy.

13:48.630 --> 13:50.430
So we need to attach the script.

13:50.430 --> 13:53.470
So let's go over to script folder in our project app.

13:53.470 --> 13:58.990
And let's select this Apple Script and drag it over to Add Component section in the Inspector.

13:58.990 --> 14:06.030
And make sure you attach that in into your parent game object of Apple, not the child one.

14:06.190 --> 14:11.510
And now we can see underneath our Apple script, we can see an animator component.

14:11.510 --> 14:16.070
And we'll just pop up and it says none animator.

14:16.070 --> 14:22.350
So what we're going to do, we do know that animator component is sitting on this Apple icon game object.

14:22.350 --> 14:24.950
So we're going to select that and drag it over to that.

14:24.950 --> 14:29.110
And now as you can notice we have the Apple Icon Animator.

14:29.110 --> 14:30.830
And now we're just going to speed up.

14:30.830 --> 14:34.950
To do that let's open up our Apple Script by double clicking on it.

14:35.350 --> 14:38.150
And we're gonna move over to this start function.

14:38.200 --> 14:41.680
And we do know that a start function get call in the start of the game.

14:41.800 --> 14:49.160
So in this start of the game, what we want, we just want to speed up our animation of that Apple Apple.

14:49.360 --> 14:53.680
And to speed that up we basically need to move over to animator component.

14:53.680 --> 14:56.160
And then we're going to access dot speed.

14:56.160 --> 14:58.320
And we can set the speed that we like.

14:58.320 --> 15:00.720
So let's make a variable for our speed.

15:00.720 --> 15:07.320
And we're gonna adjust underneath our inspector inspector underneath our Apple script.

15:07.320 --> 15:13.680
So let's go to top of our class and let's declare another variable serialize fail private.

15:13.680 --> 15:15.080
And this is going to be float.

15:15.080 --> 15:18.640
And we can simply call this one speed animation speed.

15:18.640 --> 15:23.000
So let's call it animation speed animation speed.

15:23.000 --> 15:26.960
And by default I'm going to set something around 1.5 F.

15:26.960 --> 15:28.200
And let's close that up.

15:28.200 --> 15:29.120
Semicolon.

15:29.120 --> 15:33.560
And now let's move over to this animator dot speed basically accessing the speed.

15:33.560 --> 15:36.080
And we're going to set our animation speed.

15:36.320 --> 15:38.480
And let's close that up with semicolon.

15:38.480 --> 15:43.960
So in this start of the game it's gonna be animation speed, which is by default we set 1.5.

15:44.120 --> 15:48.040
So our animation speed just gonna be a little bit high.

15:48.400 --> 15:53.760
So basically what we're doing firstly we're going over to this Apple icon GameObject and going over

15:53.760 --> 15:56.720
to this animator component of this Apple icon.

15:56.720 --> 16:01.640
And then we just accessing the speed parameter of this animator component.

16:01.640 --> 16:05.120
And we just set it equal to our animation speed.

16:05.120 --> 16:07.240
So basically that is the thing we're doing.

16:07.560 --> 16:09.960
So now let's move over to our scape.

16:09.960 --> 16:13.560
And we're going to press down Ctrl s in order to save our scape.

16:13.560 --> 16:19.800
But before I save I'm going to remove this update function since we don't need and also this comment

16:19.800 --> 16:27.200
right over here to just make our, uh, you can simply say our code a little bit clean and make sure

16:27.200 --> 16:33.560
you do this practice because it's, um, just going to make your, uh, code clean.

16:33.560 --> 16:36.530
And we're going to press Ctrl control S to save our skip.

16:36.530 --> 16:38.330
And now let's move over to unity.

16:38.610 --> 16:45.170
So we will able to notice underneath our apple strip another field just gonna pop up.

16:45.170 --> 16:47.970
And we just name that as animation speed.

16:47.970 --> 16:50.810
And by default we have given 1.5.

16:50.850 --> 16:53.730
But you can just go with any number that you like.

16:54.050 --> 17:00.290
And now if I select my Apple GameObject in the hierarchy then go over to Inspector, then Apple Script.

17:00.290 --> 17:04.850
We can notice we have the animator component as well as animation speed.

17:05.250 --> 17:10.970
So if I just go ahead and then click on this play button in the top, you will be able to notice the

17:10.970 --> 17:13.290
animation speed of this apple.

17:13.290 --> 17:15.570
Just going to be a little bit faster.

17:15.610 --> 17:25.210
As as we saw earlier, it's going to be a little bit faster that of you can simply say of that.

17:25.330 --> 17:32.050
So if I get out of play mode and if I set this animation speed to something like two, and then click

17:32.050 --> 17:33.940
on this play button in the top.

17:33.980 --> 17:41.500
In order to play our game, you're gonna notice that our animation is gonna be a little bit faster than

17:41.540 --> 17:45.300
previous speed because we just set the animation speed to two.

17:45.660 --> 17:46.940
So just wait a moment.

17:47.580 --> 17:50.540
And indeed, animation is just doing fine.

17:50.940 --> 17:56.100
And if I select my animator tab and then select this Apple icon, we cannot see.

17:56.100 --> 17:57.500
So let's get out of play mode.

17:57.500 --> 18:03.740
And if you just get this type of weird behavior, basically means if you select the game object and

18:03.740 --> 18:10.420
you not able to notice your animation clip animator there, then what you can do is you can simply right

18:10.420 --> 18:16.100
click on this animator tab, then click on this close tab and make sure you just go to window in the

18:16.140 --> 18:16.740
top bar.

18:16.900 --> 18:23.020
Then in the bottom you can see animation and the animation is control six as well.

18:23.020 --> 18:28.740
We have the animator so we can simply click on it and we can just toggle it right over here.

18:28.740 --> 18:36.910
And now if I select my Apple icon and by now we can see our Apple idol as well as Apple collected.

18:36.910 --> 18:40.150
So we need to make transition between this animation clip.

18:40.270 --> 18:41.790
So let's select the parameter.

18:41.790 --> 18:43.430
Let's click on this plus icon.

18:43.430 --> 18:45.070
And we're going to choose a trigger.

18:45.270 --> 18:48.510
And we're going to call this one something like collected.

18:48.510 --> 18:51.550
So let's call it collected collected.

18:51.550 --> 18:53.670
And we're going to choose that animation.

18:53.670 --> 18:57.630
So let's make transition from this idle to our Apple collected.

18:57.630 --> 18:59.870
And make sure you select your Apple Game object.

18:59.870 --> 19:03.710
Basically the child one underneath your Apple Game object in the hierarchy.

19:04.030 --> 19:06.470
And then go over to this animator tab.

19:06.470 --> 19:11.110
So let's right click on this Apple idle and make transition to Apple collected.

19:11.150 --> 19:14.070
And and we will select our arrow.

19:14.110 --> 19:15.310
Basically the transition.

19:15.310 --> 19:16.910
Let's go over to Inspector.

19:17.070 --> 19:20.670
And we're going to uncheck the has exit time and transition duration.

19:20.670 --> 19:26.310
We're going to set it to zero because as soon as we collect this apple we just want to play the Apple

19:26.310 --> 19:28.670
collected animation clip right away.

19:28.910 --> 19:35.550
So that's why I just set the transition duration to zero as well as I just uncheck the has exit time.

19:35.590 --> 19:38.790
And now if we scroll down we need to choose the condition.

19:38.790 --> 19:42.030
So we're going to choose this collected trigger condition.

19:42.030 --> 19:43.990
So let's click on this plus icon.

19:43.990 --> 19:45.790
And we're going to choose this collected.

19:45.950 --> 19:53.630
And now also we don't want to play that Apple collected animation clip over again and again.

19:53.630 --> 19:54.910
So we're gonna uncheck the loop.

19:54.950 --> 19:55.630
Time for it.

19:55.670 --> 20:01.430
What we need to do we need to move over to our project tab assets and then animation folder.

20:01.430 --> 20:06.390
And inside our animation folder we created this items animation sub folder.

20:06.390 --> 20:07.630
As you can notice.

20:07.630 --> 20:09.870
And we can see both of these animation clip.

20:09.870 --> 20:13.390
We have the apple idle as well as Apple collected.

20:13.390 --> 20:15.390
So we're gonna choose the apple collected.

20:15.430 --> 20:18.790
Then go over to Inspector and we're gonna uncheck the loop time.

20:18.990 --> 20:24.830
And now if I select my animator tab and then click on this play button in the top and try to trigger

20:24.830 --> 20:31.000
this collected parameter manually, you will able to notice that Apple collected animation.

20:31.000 --> 20:36.920
Just gonna play right away as soon as we're gonna trigger this collected parameter, because we have

20:36.920 --> 20:38.800
chosen that condition, so that's why.

20:39.520 --> 20:46.320
So now if I manually try to trigger this apple collected, as you can see, it's played the, uh, Apple

20:46.320 --> 20:48.600
collected animation clip right away.

20:48.920 --> 20:50.440
And that's pretty much cool.

20:50.440 --> 20:55.640
So I hope you get the idea that how you can do it and we're gonna get out of play mode and make sure

20:55.640 --> 21:00.520
you, Apple, make sure you select your apple and turn it into prefab.

21:00.520 --> 21:06.640
So you're gonna have the copy and you can later on use the copy and just place it around your level.

21:06.840 --> 21:09.840
So I'm gonna move over to my uh, console tab first.

21:09.840 --> 21:12.360
And I'm going to create this messages.

21:12.840 --> 21:17.440
And I'm going to select my project tab, then assets and then prefabs folder.

21:17.640 --> 21:20.440
And let's select the Apple GameObject in the hierarchy.

21:20.440 --> 21:26.400
And let's drag it over to inside this prefabs folder in order to turn it into a prefab.

21:26.400 --> 21:28.640
Or you can simply say copy of it.
