WEBVTT

00:06.910 --> 00:08.080
Welcome back.

00:08.080 --> 00:10.900
Now our loot is looking pretty sweet.

00:10.900 --> 00:12.760
It's bobbing up and down.

00:12.760 --> 00:14.050
It looks nice and smooth.

00:14.050 --> 00:20.500
It's rotating and I really like how it looks, except for when they're spawned in and when they're spawned

00:20.500 --> 00:20.710
in.

00:20.710 --> 00:25.360
We just get this basic, you know, kind of just shows up.

00:25.360 --> 00:26.110
Right.

00:26.110 --> 00:30.790
And for that reason, I think I'd like something a little bit more special.

00:30.790 --> 00:32.620
I'd like it to fly up and down.

00:32.620 --> 00:34.690
Now, we could handle this in different ways.

00:34.690 --> 00:40.000
You could enable physics, for example, and just let physics handle things.

00:40.000 --> 00:46.240
I tend to like when it comes to stylized games like this, a little bit more of a stylized, more controlled

00:46.240 --> 00:49.480
approach that doesn't have to do with physics.

00:49.480 --> 00:55.990
I'd like to sort of use curves or timelines when making things fly up and hit the ground.

00:55.990 --> 01:03.130
So for that reason, I'd like to control the vertical position of this based on a curve.

01:03.160 --> 01:10.420
Now we have our BP pickup base, which can set the actor location based on our calculated location,

01:10.420 --> 01:15.610
and we could use a curve to add to the calculated location.

01:15.610 --> 01:25.510
We could use some kind of timeline that can take that calculated location and add a value to its z component,

01:25.510 --> 01:26.740
for example.

01:26.740 --> 01:33.070
And then every tick, we could just use that calculated location when setting the actor location.

01:33.070 --> 01:39.640
So if we're running a timeline, then calculated location could be affected by it.

01:39.640 --> 01:43.420
So right here I'd like to make a timeline right and begin play.

01:44.530 --> 01:49.570
I'm going to add a timeline and call this pickup elevation.

01:50.500 --> 01:56.320
Timeline and we'll go ahead and play it first thing and double click.

01:56.320 --> 01:56.920
Give it a float.

01:56.950 --> 02:00.640
Track and call this track elevation.

02:01.610 --> 02:04.730
It's going to be normalized between 0 and 1.

02:04.730 --> 02:14.750
And I'm just going to create a simple curve that starts off with zero at zero and goes to perhaps zero

02:14.750 --> 02:17.990
at 0.75 or so, or maybe 0.8.

02:19.530 --> 02:22.800
And our length of the curve will be 0.8 seconds.

02:24.830 --> 02:28.190
And we'll have one in the middle at 0.4.

02:29.640 --> 02:33.240
Right in the center, and this will be at a value of one.

02:33.390 --> 02:40.020
And I'm going to zoom out and select all of these and make them auto so that we have this kind of curve.

02:40.020 --> 02:46.830
And I'm going to take these endpoints here and angle them upward so that I have more of a parabolic

02:46.830 --> 02:49.110
shape, more of a parabola.

02:49.110 --> 02:54.540
And in fact I could go up to one second if I wanted some undershoot.

02:54.540 --> 03:00.300
Let's go to 1.5 actually, and I could add a key here and add a key here.

03:00.300 --> 03:03.780
And as long as these are auto curves.

03:05.360 --> 03:09.110
We can shape this so that we have a bit of an undershoot.

03:10.770 --> 03:19.650
So with this I have a 1.5 second timeline giving this elevation value and each update.

03:19.650 --> 03:28.470
I'd like to take this elevation value and multiply it by a max elevation, some kind of apex.

03:28.470 --> 03:32.970
I'm going to promote it to a variable and call this spawn apex.

03:33.420 --> 03:35.460
And this can have its own value.

03:35.460 --> 03:41.550
It could even be randomized too, but I'm just going to make it a constant with a value of 100.

03:41.550 --> 03:48.360
And each time this update occurs we're going to add to our calculated location.

03:48.360 --> 03:50.610
So we'll get calculated location.

03:50.610 --> 03:56.520
We'll set calculated location, which we can't do unless it's blueprint read write.

03:56.520 --> 03:58.260
So we'll have to change that.

03:58.260 --> 04:00.450
Let's just do that real quick.

04:00.450 --> 04:04.740
Back in our effect actor, we'll set calculated location.

04:05.190 --> 04:06.300
We'll make it blueprint.

04:06.300 --> 04:07.200
Read write.

04:09.200 --> 04:13.940
While I'm at it, I'm just going to make calculated rotation blueprint read write as well and we'll

04:13.940 --> 04:15.860
go ahead and launch again.

04:16.100 --> 04:18.590
So we'll get this blueprint back open.

04:19.460 --> 04:22.160
Back in BP pickup base.

04:22.160 --> 04:25.040
And we need to set calculated location.

04:26.240 --> 04:27.680
Now what are we setting it to.

04:27.710 --> 04:30.890
We can't set it to itself plus this curve value.

04:30.920 --> 04:34.190
We have to set it equal to actually its initial value.

04:35.640 --> 04:39.420
Initial location, we'll have to use initial location.

04:39.870 --> 04:41.070
Plus.

04:41.640 --> 04:43.980
This value for the z component.

04:43.980 --> 04:47.520
So I'm going to actually make a vector.

04:47.520 --> 04:49.320
I'll make a vector from the float.

04:50.400 --> 04:53.880
So I'm going to use make vector disconnecting that though.

04:54.870 --> 04:59.010
And I'm going to use the initial locations x and y.

04:59.040 --> 05:01.830
So I need to break this vector.

05:03.510 --> 05:09.090
And use x and y, but for the Z, we're going to use what?

05:09.090 --> 05:12.810
Well, we're going to use the initial location plus.

05:13.490 --> 05:14.990
The curve value, of course.

05:14.990 --> 05:15.920
Scaled by spawn.

05:15.950 --> 05:16.790
Apex.

05:18.400 --> 05:21.070
And that's going to be the calculated location.

05:21.070 --> 05:22.420
So we're going to update this.

05:22.420 --> 05:29.080
And what I want to do here is I don't want to start sinusoidal movement yet.

05:29.080 --> 05:34.390
In fact I don't want to start sinusoidal movement or rotation until this curve is done.

05:34.390 --> 05:38.530
So I'm going to move these over here and call them on finished.

05:39.400 --> 05:43.570
And in the meantime we're setting calculated location I don't need that node there.

05:43.570 --> 05:44.710
And.

05:45.830 --> 05:47.810
When we spawn in.

05:48.310 --> 05:50.890
Will be flying up and back down.

05:50.890 --> 05:55.000
And then when that's done, we'll start rotating and bobbing up and down.

05:55.000 --> 05:57.550
So let's try this out.

05:58.000 --> 05:59.770
Actually, I need to load in through the menu.

05:59.770 --> 06:00.580
Of course.

06:06.640 --> 06:08.140
I could really use electrocute.

06:08.140 --> 06:11.650
That ability is really nice for killing goblins.

06:11.650 --> 06:12.550
Fast.

06:14.160 --> 06:15.570
All right, so there we go.

06:15.570 --> 06:17.310
So they fly up.

06:17.310 --> 06:23.250
They come back down and it's flying up and down according to our curve instead of physics which I like

06:23.250 --> 06:23.910
better.

06:23.910 --> 06:29.820
And then once it hits the ground, then we get a nice bobbing sinusoidal movement because we started

06:29.820 --> 06:31.080
sinusoidal movement.

06:31.080 --> 06:38.100
I'm done with my BP crystals and potions as we're just working with pickup bass, so that's great.

06:38.100 --> 06:39.300
That's looking nice.

06:39.300 --> 06:46.590
Now another thing we can do is because these just spawn in and they just appear, right.

06:46.590 --> 06:48.840
We could scale their size as well.

06:48.840 --> 06:50.940
We can scale the mesh.

06:50.940 --> 06:56.220
So first of all, to make this cleaner I'm going to collapse these.

06:56.220 --> 07:07.560
I'm going to say collapse to a function and call this calculate elevation and make this a pure blueprint

07:07.560 --> 07:08.610
pure function.

07:09.620 --> 07:12.200
That's going to make things easier to see.

07:12.920 --> 07:15.530
And we can even avoid crisscrossing.

07:17.340 --> 07:18.300
Like this.

07:20.570 --> 07:26.240
Now, in addition to this, we can have another curve value as we're running this curve.

07:26.270 --> 07:32.660
We can also have another track float track called scale.

07:33.380 --> 07:38.360
And this can be basically going from zero up to one.

07:38.360 --> 07:45.200
And we can even have a little bit of some bobbing behavior too, especially when we get to about here

07:45.200 --> 07:48.800
where the item flies up and comes back down.

07:48.800 --> 07:53.510
What we can do is give it a little bit of a bobbing motion to the scale as well.

07:53.510 --> 07:54.290
So here's what I'm going to do.

07:54.290 --> 08:01.040
I'm going to make a key on time zero at zero and very rapidly go up to one.

08:01.040 --> 08:04.130
So I'm going to have another key here at time.

08:04.130 --> 08:11.480
Let's make it 0.1 and we'll have it go up to let's go up to 1.2.

08:11.510 --> 08:19.070
And I'll have another key that Undershoots will go down to about 0.82.

08:19.070 --> 08:22.100
And another key that overshoots slightly.

08:24.320 --> 08:25.880
And then a key at one.

08:26.240 --> 08:28.820
So this will have a value of one.

08:28.850 --> 08:34.040
Now of course I'm going to want these to be auto, but I'm going to hold off on making them auto for

08:34.040 --> 08:34.310
now.

08:34.310 --> 08:40.340
I'm going to come all the way over to the part where they hit the ground and make them bob a little

08:40.340 --> 08:40.820
bit more.

08:40.820 --> 08:52.010
So I'm going to put a key here and a key here, and we'll undershoot, overshoot and then back to one.

08:53.320 --> 08:57.850
So now I'm going to make them all auto curves and shape them.

08:57.850 --> 09:00.070
I want this first one going straight.

09:00.770 --> 09:03.680
Going up like this will overshoot a little.

09:06.760 --> 09:08.710
I'll make this one a little more straight.

09:10.540 --> 09:18.070
And if I want to rotate this on one side but not the other, I can actually right click and make this

09:18.280 --> 09:24.370
broken so I can use break, and then I can use one side at a time by selecting that.

09:24.370 --> 09:26.110
And that's what I'd like for this case here.

09:26.110 --> 09:28.600
I'd like to go up and down again.

09:28.600 --> 09:29.920
So now we have this curve.

09:29.920 --> 09:37.060
And we can scale our meshes, scale our actors, scale using this value.

09:37.060 --> 09:41.800
So what I can do is I can simply call set scale 3D.

09:42.700 --> 09:45.040
We'll use set actor scale 3D.

09:45.870 --> 09:49.980
And for this scale 3D, I can right click.

09:51.270 --> 09:54.720
And split the struct pin and we can use this scale value.

09:54.750 --> 09:56.130
I'm going to reroute it.

09:58.280 --> 10:03.710
And reroute it, and then plug in the same value for all three of these.

10:06.360 --> 10:09.660
And that's going to scale according to the curve.

10:09.660 --> 10:10.920
Let's see how that looks.

10:13.860 --> 10:15.960
Now, I'd like to see this in slow motion.

10:15.960 --> 10:22.140
So I'm going to lure a couple of enemies over, and then I'm going to hit Tilda.

10:22.140 --> 10:25.140
Slow mo point five.

10:25.140 --> 10:27.180
Now we're going half the time.

10:31.780 --> 10:33.250
There we go.

10:36.410 --> 10:37.220
Look at that.

10:37.220 --> 10:38.960
They bob and they bob.

10:38.960 --> 10:44.210
When they hit the ground, they don't really hit the ground, but they bob again when they fall down.

10:44.210 --> 10:47.120
Let's use like slo mo point one.

10:47.120 --> 10:49.880
We'll go to about 10%.

10:51.270 --> 10:52.500
Of the time.

10:52.950 --> 10:57.150
So, Tilda, slo mo point one.

10:57.150 --> 11:02.100
Now we're 10% and it's going to take a while to.

11:02.720 --> 11:04.640
Kill these things.

11:04.640 --> 11:05.870
But that's okay.

11:05.870 --> 11:06.920
It'll be worth it.

11:06.920 --> 11:07.610
Oh.

11:14.980 --> 11:17.230
We're a little close, so.

11:19.340 --> 11:20.810
Let's go.

11:24.330 --> 11:25.620
Almost there.

11:25.620 --> 11:27.480
We'll kill this one this time.

11:28.690 --> 11:29.440
Boom.

11:29.440 --> 11:32.560
Okay, now we see the potions coming up.

11:32.590 --> 11:33.970
See how they're bobbing?

11:33.970 --> 11:34.630
Bigger?

11:34.630 --> 11:35.380
Smaller.

11:35.380 --> 11:39.010
They're kind of like they look a little bit like they're sort of rubbery.

11:39.010 --> 11:46.660
And when they hit the lowest point, then they bob again, and then they start rotating, doing their

11:46.660 --> 11:48.640
bobbing sinusoidal motion.

11:48.640 --> 11:50.230
I think that looks great.

11:50.740 --> 11:55.420
So that's a little bit more of a stylized way to handle spawning these things.

11:55.420 --> 11:57.490
And I think that looks really nice.

11:57.490 --> 12:02.680
It gives for a better effect than just spawning them in, making them appear, you know.

12:03.160 --> 12:08.170
Now the last thing that we can give to these looks like I hit myself.

12:08.170 --> 12:09.460
I could target myself.

12:09.790 --> 12:13.630
The last thing for these pickups that I'd like to do is sounds.

12:13.630 --> 12:20.170
And I have some sounds for spawning in these potions.

12:20.170 --> 12:28.540
And really, I don't have sounds for the crystals, but we can just reuse the same sounds for the crystals

12:28.540 --> 12:31.390
as for the potions.

12:31.390 --> 12:37.630
And so I think that'll give us one last final touch for spawning these items.

12:37.630 --> 12:39.280
So we'll do that next.

12:39.280 --> 12:41.140
Great job and I'll see you soon.
