WEBVTT

00:06.840 --> 00:08.040
Welcome.

00:08.490 --> 00:11.970
Now, throughout our levels, we're going to have enemies.

00:12.330 --> 00:18.270
Now, sometimes you may not want all of your enemies spawned at the beginning of the game, even if

00:18.270 --> 00:24.480
your player controlled character starts off way far enough away from them for them to even find the

00:24.480 --> 00:28.350
nearest player, they're still taking up resources, aren't they?

00:28.350 --> 00:37.170
And you may not want them to spawn in until your player controlled character has progressed to a certain

00:37.170 --> 00:37.770
area.

00:37.770 --> 00:44.970
For example, maybe in this little mini dungeon, you may not wish to spawn any characters until Ora

00:44.970 --> 00:50.700
runs through this hallway here, at which point you may wish to spawn in some enemies back here.

00:50.700 --> 00:52.620
Now I'm going to go ahead and take this.

00:52.650 --> 00:58.650
It's sort of in the way at this point, and I'm going to, I think, remove it for now.

00:58.650 --> 01:05.070
And let's just say we want a couple of goblins back here, but we don't want them to exist until Ora

01:05.070 --> 01:06.900
runs through here right?

01:06.900 --> 01:15.720
Only at that point do we want those goblins to spawn in, and this little section here is going to bother

01:15.720 --> 01:17.790
me, so I'm going to move it in slightly.

01:17.790 --> 01:25.050
Okay, now with our current system, because there's a nav mesh bounds volume over the entire level,

01:25.050 --> 01:32.820
if I drag in, say, two goblin spear enemies by going to Character Goblin Spear and just bringing in

01:32.820 --> 01:33.420
two.

01:33.450 --> 01:36.510
Well, if I press play, what do you think is going to happen?

01:36.510 --> 01:38.490
They're going to come in after me, right?

01:38.490 --> 01:39.810
They're coming for me.

01:39.810 --> 01:42.240
And maybe that's not what you want.

01:42.270 --> 01:45.990
Maybe you want them to not even be there yet.

01:45.990 --> 01:49.350
That's why I'd like to create a spawn volume.

01:49.350 --> 01:55.920
Some kind of actor that has an invisible volume, perhaps a box component that once we overlap with

01:55.920 --> 02:00.660
that box component, then we can spawn in enemies at any location we want.

02:00.690 --> 02:03.450
Say I run in through the hallway here.

02:03.450 --> 02:05.280
As soon as I run in through the hallway.

02:05.280 --> 02:13.380
I'd like two spear enemies here and perhaps a slingshot goblin somewhere up there, just for example.

02:13.470 --> 02:16.200
How can we manage to make that happen?

02:16.200 --> 02:19.380
Well, that's actually not too difficult.

02:19.380 --> 02:25.500
And if you're so inclined, take it as a mini challenge to create this system right now.

02:25.500 --> 02:27.240
Otherwise, let's get started.

02:27.240 --> 02:29.760
I'm going to create a spawn volume.

02:29.760 --> 02:36.450
Now that's going to be an actor, but I'd also like to create a new class for a target point that can

02:36.450 --> 02:37.560
be placed in the world.

02:37.560 --> 02:41.910
Now there exists a class in the engine called Target Point.

02:41.910 --> 02:48.780
In fact, if we go to the Place Actors panel and search for target, this is the target point actor.

02:48.780 --> 02:49.860
It's quite simple.

02:49.860 --> 02:57.210
We can drag it in and it is simply an actor with a billboard that looks like a target, and we can use

02:57.210 --> 02:59.850
it for its location in the world.

02:59.880 --> 03:04.140
I'd like to use this class, but I'd like to subclass it.

03:04.140 --> 03:09.540
It would be nice if I could bring in a target point, and here in the details panel, select the character

03:09.540 --> 03:13.350
class and its level to spawn a character in at.

03:13.350 --> 03:19.830
So that's my goal, and I'm going to create a class based on this target point actor to do that.

03:19.830 --> 03:22.530
So I want two new classes, right?

03:22.530 --> 03:27.810
I'm going to open up my C plus Plus classes folder into Aura Public.

03:27.810 --> 03:30.900
And these can go into the actor folder.

03:30.900 --> 03:36.600
First I'm going to make a new C plus plus class and search for Target Point.

03:36.990 --> 03:43.320
I'm going to choose Target Point and I'm going to call this aura Enemy spawn point.

03:43.320 --> 03:44.640
I'm going to create this class.

03:44.640 --> 03:47.700
I'm going to click no because I want to create another one.

03:47.700 --> 03:51.720
And this one is going to be a simple actor.

03:51.720 --> 03:54.480
So I'm going to select actor next.

03:54.480 --> 03:58.680
And this will be called Aura Enemy Spawn Volume.

03:58.680 --> 04:02.100
And we'll go ahead and create this class and close out.

04:02.880 --> 04:05.520
Now what are these classes going to have.

04:05.520 --> 04:08.700
Well they're not going to be extremely complicated.

04:08.700 --> 04:14.640
Let's get them both open I'm going to get their CP files open first so they can stay to the left.

04:14.640 --> 04:22.080
I'm going to open first my aura enemy spawn point dot CP and aura enemy spawn point dot h, then aura

04:22.080 --> 04:27.030
enemy spawn volume dot cp and aura enemy spawn volume dot h.

04:27.030 --> 04:33.150
Opening them in that order puts them up in the order that I want them to be in.

04:33.630 --> 04:43.170
Lifehack now aura enemy spawn point doesn't need much, but I'd like it to have at least some information

04:43.170 --> 04:43.410
now.

04:43.410 --> 04:49.260
It'd be really, really useful if the spawn point itself could contain the class to spawn.

04:49.680 --> 04:55.110
So what I'm going to do is make a public section and give this a subclass of.

04:55.790 --> 05:00.800
Of class a ora enemy not enemy.

05:00.800 --> 05:03.890
Spawn point a ora enemy.

05:03.920 --> 05:05.090
The actor.

05:05.420 --> 05:10.130
Now yes, I know I've been forward declaring up at the top the whole time.

05:10.130 --> 05:12.170
Why would I go and break that convention?

05:12.170 --> 05:12.740
Now?

05:12.740 --> 05:18.230
Let's just keep that consistent and we'll call this enemy class.

05:19.250 --> 05:27.860
Of course it gets a U property, but it's going to be edit anywhere, blueprint read only and category

05:28.370 --> 05:29.840
enemy class.

05:32.080 --> 05:36.100
Now, I'd also like to spawn an enemy in at a given level.

05:36.100 --> 05:41.290
So I'm going to make an INT 32 called enemy level and set it to one by default.

05:41.290 --> 05:43.960
So if we don't set it well, we don't have to worry.

05:43.960 --> 05:46.030
We'll get a level one enemy.

05:46.060 --> 05:48.640
I'll give it the same exact U property.

05:48.640 --> 05:51.370
And finally an E character class.

05:51.370 --> 05:56.470
We're going to add the include and that include is for character class info.

05:56.470 --> 05:58.180
So we'll just get that include.

05:58.180 --> 06:00.730
And this is going to be the character class.

06:00.730 --> 06:07.960
This can get an E character class warrior value by default if we don't set it.

06:07.960 --> 06:10.330
And again same U property.

06:11.600 --> 06:18.470
And finally, I'd like each of these spawn points to be able to spawn their own enemy so we can give

06:18.470 --> 06:20.540
it a function called Spawn enemy.

06:21.980 --> 06:27.710
And this can even be blueprint callable so as to maximize its usefulness.

06:27.710 --> 06:31.550
And we can go ahead and define spawn enemy.

06:31.670 --> 06:34.520
So what is spawn enemy going to do.

06:34.550 --> 06:37.430
Well it's going to spawn an enemy of course.

06:37.430 --> 06:42.590
And I'd like to make some f actor spawn parameters called spawn params.

06:44.000 --> 06:46.190
Spelled correctly for the enemy.

06:46.190 --> 06:52.640
And the first thing I'm going to set on spawn params is the spawn collision handling override.

06:52.640 --> 06:59.210
Because not having this set right could give you some behaviors that you don't expect.

06:59.210 --> 07:03.710
So I'm going to use e spawn actor collision handling method.

07:03.740 --> 07:11.030
Adjust if possible, but always spawn that way, even if there's stuff in the way and we can't quite

07:11.030 --> 07:15.080
adjust the location good enough, which shouldn't be the case.

07:15.080 --> 07:20.420
If you are a good level designer and put these points in places, that shouldn't be problematic, but

07:20.420 --> 07:24.260
still we'll adjust if possible, but still always spawn.

07:24.830 --> 07:27.560
Now for the spawning, right?

07:27.560 --> 07:36.620
I'm going to make an A or a enemy called enemy and use get world spawn actor.

07:36.620 --> 07:41.030
And I'm actually going to use spawn actor deferred a or enemy.

07:41.060 --> 07:43.430
Now we do need to pass in enemy class.

07:43.430 --> 07:47.870
Of course, and we can give it the transform with Get Actor Transform.

07:47.870 --> 07:51.650
This will get the transform of this spawn point.

07:51.830 --> 07:55.580
But I want a spawn actor deferred because I want to set some things on the enemy, right?

07:55.580 --> 07:59.540
The enemy needs to come in at the correct character level.

07:59.540 --> 08:00.590
So.

08:01.070 --> 08:03.140
So our enemies have a level.

08:03.140 --> 08:07.400
Let's go back and look at what that's called in the character folder.

08:07.400 --> 08:12.590
Let's go to the public folder character or enemy and search for level.

08:12.590 --> 08:16.610
And I believe it's actually just called level but it's protected.

08:16.610 --> 08:18.770
We want to be able to set that level.

08:18.770 --> 08:21.770
So I'm just going to make a public getter for it.

08:21.770 --> 08:25.820
And while we're at it, what about our character class as well?

08:25.820 --> 08:28.910
Looks like that is something on the character base.

08:28.910 --> 08:33.170
And that is going to be protected as well.

08:33.170 --> 08:36.110
So we're going to need a function to set both of these.

08:36.110 --> 08:39.320
Set the character class and set the level.

08:39.320 --> 08:47.780
Let's add a public function to set the character class first void set character class e character class

08:47.780 --> 08:48.890
class.

08:48.890 --> 08:52.190
And it's going to set character class.

08:53.490 --> 08:54.300
Equal to class.

08:54.300 --> 08:57.180
In fact, let's call this in class.

09:00.490 --> 09:05.830
Class is just too close to things with other meanings in C plus plus.

09:07.080 --> 09:13.080
So we got that public setter in or a character base, and then our enemy is going to have a void set

09:13.080 --> 09:20.340
level and 30 whoops and 32 in level.

09:21.800 --> 09:25.220
And level equals in level.

09:27.100 --> 09:31.840
So we have those setters and our or enemy spawn point can call set level.

09:31.840 --> 09:39.280
Now I'm going to close our enemy close or a character base and we have enemy level.

09:40.760 --> 09:45.140
We can set that and we can set the character class.

09:45.140 --> 09:50.630
So enemy set character class, character class.

09:51.960 --> 09:56.880
Now we can finish spawning so we can say enemy finish spawning.

09:59.220 --> 10:02.160
And use get actor transform.

10:03.630 --> 10:06.180
Get actor transform.

10:07.820 --> 10:11.750
And finally, one last little detail.

10:12.380 --> 10:19.490
When spawning AI characters, they're not going to spawn in with a default controller unless we call

10:19.490 --> 10:21.710
spawn default controller.

10:21.740 --> 10:24.500
Now they'll be able to run around and attack us.

10:24.650 --> 10:27.530
So now we have our enemy spawn point.

10:27.710 --> 10:28.400
Great.

10:28.430 --> 10:31.730
Now we need our enemy spawn volume.

10:31.760 --> 10:34.460
Now this is also going to be quite simple.

10:34.490 --> 10:36.080
I don't even want it to tick.

10:36.080 --> 10:38.420
I'm going to remove the tick function altogether.

10:38.450 --> 10:43.760
I'm going to remove these useless comments and remove the tick function in the cpp file.

10:43.760 --> 10:49.670
Remove the useless comments here I'm going to set B can never tick to false because I don't want a tick.

10:49.670 --> 10:51.800
And here we go.

10:52.860 --> 10:54.750
We're ready to code now.

10:54.780 --> 11:02.700
I'd like this enemy spawn volume to be a saved actor with a breached boolean, just like our checkpoints.

11:02.730 --> 11:03.270
Why?

11:03.300 --> 11:06.510
Because if we've reached this already, I'd like to save that.

11:06.510 --> 11:08.040
And next time we come into the level.

11:08.040 --> 11:10.530
I don't want to spawn those same enemies anymore.

11:10.560 --> 11:13.680
I want to consider that part of the dungeon completed.

11:13.680 --> 11:15.180
So here's what I'll do.

11:15.180 --> 11:24.660
I'll inherit publicly from the I save interface, and we can implement the function on the I save interface.

11:24.690 --> 11:27.270
Therefore we're going to say save interface here.

11:27.450 --> 11:30.630
And we're going to have an end save interface here.

11:30.630 --> 11:38.130
And this section is for virtual void load actor implementation.

11:38.130 --> 11:39.810
Let's go ahead and get that in here.

11:39.810 --> 11:44.550
And we're also going to have a boolean for when we've been reached be reached.

11:44.550 --> 11:48.480
It'll be false by default but it can get a Uproperty.

11:48.480 --> 11:50.280
We can give it blueprint read only.

11:50.280 --> 11:53.340
And we're going to make it a save game variable.

11:53.340 --> 11:57.870
That way when it's loaded back in, be reached will be set to true.

11:57.870 --> 12:01.200
And we can check that in our load actor implementation.

12:01.200 --> 12:04.410
But what really is this spawn volume going to have?

12:04.410 --> 12:06.210
It's going to have a couple things.

12:06.210 --> 12:10.260
For one, it's going to need a box component.

12:10.260 --> 12:12.750
I'd like a private section for that.

12:12.750 --> 12:19.980
So it's going to be a T object pointer of type U box component.

12:20.250 --> 12:26.430
We're going to add a forward declaration for that and call this box give it a U property I'm sorry this

12:26.430 --> 12:28.110
is a way at the bottom of the screen.

12:28.110 --> 12:32.040
Let me scroll up a little bit and visible anywhere we'll have a box.

12:32.040 --> 12:37.650
We'll also have an on box overlap which is going to have the same signature as our other on overlap

12:37.650 --> 12:40.920
functions, such as that in the checkpoint.

12:40.920 --> 12:45.330
So we can go to checkpoint dot h and steel on sphere overlap.

12:45.330 --> 12:48.270
Of course it's now going to be called on box overlap.

12:48.270 --> 12:50.400
But we're going to steal that.

12:51.700 --> 12:57.520
And put that in the protected section on sphere overlap becomes on box overlap.

12:57.520 --> 13:01.180
And hey, we're coding, let's get this defined.

13:02.320 --> 13:11.320
And let's while we're at it in begin play, we'll take our box get on component began overlap.

13:11.860 --> 13:13.330
Add dynamic.

13:15.450 --> 13:21.780
This and a or enemy spawn volume on box overlap like that.

13:21.780 --> 13:29.940
Okay, so when our box has been overlapped, we can set first of all be reached equal to true.

13:29.970 --> 13:35.160
That way when we load the actor, we can check that if be reached is true.

13:35.160 --> 13:35.910
And you know what?

13:35.910 --> 13:38.970
This can be as simple as if be reached.

13:40.250 --> 13:48.980
Destroy, then not only can we not overlap with the box component, this actor won't even be here anymore.

13:48.980 --> 13:50.480
It's going to destroy itself.

13:50.480 --> 13:53.720
Now the constructor can do a couple things.

13:53.720 --> 13:55.160
It can construct our box.

13:55.160 --> 13:56.690
We haven't done that yet.

13:56.690 --> 14:04.880
So we can say Createdefaultsubobject you box component and we'll call this simply box.

14:05.360 --> 14:08.210
We can set the box to be the root component.

14:08.210 --> 14:15.320
We can take the box and set collision enabled to E collision enabled query only.

14:15.320 --> 14:17.210
No physics necessary.

14:18.100 --> 14:22.000
And it looks like I accidentally put be reached here.

14:22.120 --> 14:26.620
We can also set its collision object type.

14:26.620 --> 14:29.560
We can make it EQ world static.

14:30.990 --> 14:38.850
We can set its collision response to all channels and we can use ECR ignore.

14:41.390 --> 14:49.310
And we also are going to want to set the collision response to the pawn to overlap.

14:49.310 --> 14:58.880
So set collision response to channel E collision channel pawn ECR overlap.

14:59.480 --> 15:03.200
Now what would we like to do in on box overlap.

15:03.200 --> 15:06.080
Now that we're set to overlap with the pawn class?

15:06.080 --> 15:09.800
Well first I don't want to overlap with any pawns except for Ora.

15:09.800 --> 15:12.710
So I'm going to say if not.

15:13.560 --> 15:19.440
Other actor implements you player interface.

15:20.100 --> 15:20.910
We'll return.

15:20.910 --> 15:21.810
In that case.

15:21.810 --> 15:24.510
I don't want it to do anything unless it's Ora.

15:24.540 --> 15:27.570
Now, if it is Ora, I want to spawn some enemies.

15:27.570 --> 15:34.950
Which means I need some spawn points so I can go back to Ora enemy spawn volume and add an array of

15:34.950 --> 15:35.730
those.

15:36.420 --> 15:45.750
So this will be a ora enemy spawn point pointers called spawn points, and I want to set this from each

15:45.750 --> 15:48.000
individual instance in the world.

15:48.000 --> 15:50.100
So this is going to be edit anywhere.

15:50.130 --> 15:53.460
Now for spawn points we're going to loop over these.

15:53.460 --> 16:02.340
So we're going to say for a or an enemy spawn point we'll call it point in spawn points.

16:03.840 --> 16:05.880
And we'll check if that point is valid.

16:05.880 --> 16:07.980
So if is valid point.

16:11.160 --> 16:15.540
Then if it is valid, we'll take the point and we'll call spawn enemy.

16:15.960 --> 16:24.210
And by the end of all this, after that for loop, I'm going to destroy this spawn volume.

16:24.210 --> 16:25.050
And that's it.

16:25.050 --> 16:27.420
That's all the spawn volume is going to do.

16:27.420 --> 16:33.720
So let's go ahead and run and debug mode and make a couple of blueprints based on this.

16:34.200 --> 16:34.920
All right.

16:34.920 --> 16:38.250
So I'm going to make a new folder in blueprints.

16:39.330 --> 16:43.080
We'll call this spawn volumes.

16:43.680 --> 16:52.530
Here in spawn volumes, I'm going to make a new blueprint based on our enemy spawn volume called BP

16:52.530 --> 16:54.930
Spawn Volume.

16:55.770 --> 17:04.110
I'm also going to make a new blueprint based on our enemy spawn point, and we'll call this BP Spawn

17:04.110 --> 17:04.980
point.

17:05.460 --> 17:08.280
Now first I'm going to configure the spawn point.

17:08.280 --> 17:11.490
I'm going to give it some default values for the enemy class.

17:11.490 --> 17:13.800
I'll give it BP Goblin Spear.

17:13.830 --> 17:16.110
I'll let it be a level one warrior.

17:16.910 --> 17:18.470
And that's all good.

17:19.580 --> 17:22.460
Now for BP spawn volume.

17:22.460 --> 17:28.460
I'm going to take my box and set its line thickness to something bigger, like five, so we can see

17:28.460 --> 17:29.390
it in the world.

17:29.390 --> 17:35.780
And for now, I think I'm going to set hidden in game to false so I can see it even in the game.

17:35.780 --> 17:40.280
And I'm going to bring one in right here into the hallway.

17:40.280 --> 17:47.540
And with it selected, I'm going to select its box and adjust the box extent like so.

17:47.540 --> 17:52.130
Now that I have a box extent, I can give it a couple of points.

17:52.130 --> 17:55.520
So I'm going to bring in two spawn points.

17:55.520 --> 18:00.290
One here, I'll bring it up a bit as if it's in the ground.

18:00.290 --> 18:02.930
That can cause some issues with spawning.

18:03.080 --> 18:07.940
Now these have default values of BP Goblin spear.

18:07.940 --> 18:14.900
All I need to do is add them to my box as it has a spawn points array, so we can take spawn points

18:14.900 --> 18:21.620
and add two elements and use the eyedropper tool and choose one and use the eyedropper tool and choose

18:21.620 --> 18:22.280
the other.

18:22.280 --> 18:24.980
And now it has points.

18:26.280 --> 18:30.630
So saving all we can press play and we can overlap.

18:30.630 --> 18:35.640
We see that the box went away and here come a couple of enemies.

18:36.300 --> 18:41.370
Now I'm seeing that they're not attacking, so that's a problem.

18:41.370 --> 18:44.400
But our spawn volume works.

18:44.400 --> 18:47.490
So let's see what's going on with I.

18:47.760 --> 18:49.230
We'll go to the AI.

18:49.260 --> 18:56.160
Let's take a look at the tasks and BT attack right here.

18:56.190 --> 18:59.970
Let's see if we're even getting this attack task.

18:59.970 --> 19:00.930
We'll print the string.

19:00.930 --> 19:01.710
Hello.

19:02.770 --> 19:04.960
And let's get those enemies in.

19:04.960 --> 19:05.470
Okay.

19:05.470 --> 19:05.860
We're getting.

19:05.860 --> 19:06.640
Hello.

19:07.630 --> 19:13.090
We're going to try Activate Abilities by tag so we can go to the melee ability, blueprints, ability

19:13.090 --> 19:20.170
system, enemy abilities, melee attack, and I don't see any montage.

19:20.200 --> 19:22.600
I'd like to make sure that our.

19:23.350 --> 19:24.910
Goblin spear.

19:27.160 --> 19:29.380
Has its attack montages.

19:31.470 --> 19:33.720
For some reason it does not.

19:33.750 --> 19:40.500
I'm going to click plus and give it its attack montage.

19:42.000 --> 19:44.160
Am attack Goblin spear.

19:44.640 --> 19:46.920
I'll give it its montage tag.

19:46.920 --> 19:50.610
Let's see what our Goblin slingshot has.

19:54.570 --> 19:56.880
It has montage attack one.

19:57.830 --> 19:59.330
Goblin spear can get.

19:59.330 --> 20:01.130
Montage attack one.

20:02.400 --> 20:10.500
And the socket tag is going to be combat socket weapon impact sound.

20:12.820 --> 20:14.860
I believe was SFX swipe.

20:17.320 --> 20:18.430
No it wasn't.

20:18.430 --> 20:21.280
It was actually Goblin swoosh.

20:21.310 --> 20:22.180
Yes.

20:27.490 --> 20:28.360
Okay.

20:30.000 --> 20:32.040
So that got reset somehow.

20:32.040 --> 20:34.170
Let's make sure that that's going to work.

20:35.550 --> 20:36.390
Yep, there we go.

20:36.390 --> 20:40.320
Now, of course, aura dies because we're not loading in from disk.

20:40.320 --> 20:42.390
She's actually loading in with zero health.

20:42.390 --> 20:45.510
Notice those ghost globes go all the way down to zero.

20:45.510 --> 20:53.460
But the important thing is that these enemies spawn in and they attack and cause damage as expected.

20:53.460 --> 20:56.640
Okay, so we have spawn volumes.

20:56.640 --> 20:57.780
This is great.

20:57.780 --> 21:07.560
And we can also check to see if they're being saved by going in and loading from the load menu.

21:08.100 --> 21:12.060
I'm going to go ahead and just delete any slots I have and make a new one.

21:13.230 --> 21:17.130
Load that slot and run in here.

21:17.250 --> 21:18.900
Trigger this volume.

21:19.890 --> 21:23.430
And I need to actually save the game.

21:23.430 --> 21:27.630
And I don't want these enemies to stun me.

21:27.630 --> 21:30.480
So I'm going to need that goblin melee attack.

21:31.290 --> 21:33.180
To not have a debuff.

21:33.180 --> 21:34.560
Chance of 100.

21:34.560 --> 21:36.090
I'm going to set it to zero.

21:37.620 --> 21:41.190
And it looks like their attack is set to damage lightning.

21:41.190 --> 21:48.420
I'm not sure how that happened or when, but I'm going to set their damage type to physical and now

21:48.420 --> 21:51.420
they shouldn't just automatically debuff me.

21:53.570 --> 22:01.580
Now I'm going to load in through the load menu, and I have to trigger this and then go back and save

22:01.580 --> 22:02.300
the game.

22:03.670 --> 22:06.130
Like so and then load back in.

22:11.820 --> 22:15.480
Okay, so it was not saved.

22:16.650 --> 22:19.830
So looking at ora enemy spawn volume.

22:20.650 --> 22:29.170
We're implementing the save interface, we're setting breached to true upon overlap.

22:29.320 --> 22:31.210
We need to make sure we're saving this.

22:31.210 --> 22:35.710
So I'm going to check out the game mode or a game mode base.

22:36.390 --> 22:40.200
And look at load world state.

22:41.740 --> 22:43.870
I'm going to place a breakpoint here.

22:45.910 --> 22:47.650
And I'm going to.

22:49.090 --> 22:51.010
Go in through the load menu.

22:52.180 --> 22:54.340
And just cycle through the actors.

22:54.340 --> 22:54.820
We're loading.

22:54.820 --> 22:56.080
We have a beacon.

22:57.500 --> 22:59.030
We have.

23:00.730 --> 23:02.140
A checkpoint.

23:03.270 --> 23:05.100
And we can see it up here.

23:05.100 --> 23:06.510
Checkpoint two.

23:07.020 --> 23:08.160
Checkpoint.

23:08.610 --> 23:09.600
Begin.

23:10.350 --> 23:11.340
And that's it.

23:11.340 --> 23:14.100
We don't get our spawn volume.

23:15.380 --> 23:22.820
So in our game mode, save slot data, I'm realizing that because we call destroy on the actor, it

23:22.820 --> 23:26.090
will not be valid by the time we save the game.

23:26.630 --> 23:34.640
So if we really want to save this actor, then we're not going to destroy at the end of spawning all

23:34.640 --> 23:40.970
of these, really, the only thing we need to do is disable the box collision and it'll destroy itself

23:40.970 --> 23:42.440
next time we load.

23:42.440 --> 23:49.700
So we'll just take the box here, set collision enabled to E.

23:49.700 --> 23:51.200
Collision enabled.

23:51.500 --> 23:52.730
No collision.

23:54.340 --> 23:56.050
That's going to fix that.

23:56.230 --> 24:00.610
So I'm going to go ahead and close out and we'll run in debug mode.

24:00.610 --> 24:03.370
So it's things like this that testing will bring to light.

24:03.370 --> 24:08.200
It'll make you realize that if you destroy this, well, next time you save the world, you're not going

24:08.200 --> 24:09.280
to actually save it.

24:09.280 --> 24:10.510
It's been destroyed.

24:10.510 --> 24:15.310
So now what we can do is we can load in through the load menu.

24:15.340 --> 24:17.290
We'll create a new slot for this.

24:19.240 --> 24:20.590
We'll go ahead and use this.

24:20.590 --> 24:21.580
We'll reach it.

24:25.410 --> 24:26.910
Now we're not destroying it.

24:26.910 --> 24:28.500
But if we save the game.

24:29.250 --> 24:31.050
And exit and come back.

24:32.840 --> 24:37.340
Looks like I still have my break point, so I'm going to remove that and continue.

24:37.760 --> 24:41.090
Now I came back in no spawn volume.

24:41.090 --> 24:43.910
It's been destroyed at the beginning of the game.

24:44.090 --> 24:44.840
Perfect.

24:44.840 --> 24:46.880
So now our spawn volumes work.

24:46.880 --> 24:51.950
We can use them to flesh out the rest of our levels.

24:52.280 --> 24:53.390
Excellent job.

24:53.390 --> 24:54.440
I'll see you soon.
