﻿1
00:00:04,330 --> 00:00:05,200
‫Hello and welcome.

2
00:00:05,200 --> 00:00:11,590
‫In this lecture, we're going to be adding an impact particle effect to wherever we hit with our rifle.

3
00:00:11,590 --> 00:00:14,050
‫So let's dive in and see how it's done.

4
00:00:14,910 --> 00:00:18,510
‫So this is going to be a quick one because we want to do something that we've already done before,

5
00:00:18,510 --> 00:00:22,710
‫which is spawn particle effects that aren't attached.

6
00:00:22,770 --> 00:00:28,980
‫Now we know that this is going to be using the new gameplay statics again, and let's go ahead and open

7
00:00:28,980 --> 00:00:30,490
‫up that header file.

8
00:00:30,510 --> 00:00:41,100
‫So gameplay static H and we want to search for the spawn emitter within here.

9
00:00:41,280 --> 00:00:47,580
‫The symbol search isn't always reliable, so I'm going to just do a search spawn emitter.

10
00:00:48,490 --> 00:00:53,260
‫And we are looking for the other versions of this spawn emitter at location.

11
00:00:53,260 --> 00:00:54,580
‫That's the one we want.

12
00:00:55,090 --> 00:01:02,170
‫And what we're going to do is it's going to need the world, the particle system, a location and a

13
00:01:02,170 --> 00:01:03,490
‫rotation.

14
00:01:03,850 --> 00:01:08,230
‫You could go with a zero rotation, but we actually want a rotation.

15
00:01:08,320 --> 00:01:11,970
‫So let's go over to the game, to the gun, C++, rather.

16
00:01:11,980 --> 00:01:16,450
‫And we're going to use this spawn emitter at location to a get world.

17
00:01:17,540 --> 00:01:23,000
‫In here, and then we are going to give it a particle system.

18
00:01:23,000 --> 00:01:25,070
‫So we need to go ahead and set one up.

19
00:01:25,070 --> 00:01:29,810
‫I'm going to leave that blank as a to do for you, seeing as we already know how to set up particle

20
00:01:29,810 --> 00:01:35,570
‫systems and then what we're going to do, we're going to get the location that's fairly straightforward.

21
00:01:35,570 --> 00:01:37,370
‫That's going to be the hit location, isn't it?

22
00:01:37,580 --> 00:01:41,450
‫And then the next thing, let me get my spacing right there.

23
00:01:41,900 --> 00:01:45,440
‫Then the next thing is going to be the rotation.

24
00:01:45,440 --> 00:01:47,390
‫Now this is slightly more complicated.

25
00:01:47,480 --> 00:01:54,080
‫Now the first thing we're going to do is we're going to create a vector for the shot direction, which

26
00:01:54,080 --> 00:01:56,690
‫is going to show us where the shot was coming from.

27
00:01:56,690 --> 00:02:01,520
‫And this one is fairly straightforward because we've already got the direction it's going in.

28
00:02:01,520 --> 00:02:05,090
‫So where it's coming from is just going to be the negative of this.

29
00:02:05,090 --> 00:02:09,050
‫So minus rotation vector is going to give us the shot direction.

30
00:02:09,050 --> 00:02:10,970
‫Where was that shot coming from?

31
00:02:10,970 --> 00:02:13,970
‫And that's going to be useful when we're applying damage later as well.

32
00:02:14,210 --> 00:02:15,410
‫So shot direction.

33
00:02:15,410 --> 00:02:15,950
‫Cool.

34
00:02:15,950 --> 00:02:16,490
‫Great.

35
00:02:16,490 --> 00:02:19,670
‫And what we want in here is a rotator.

36
00:02:19,670 --> 00:02:28,460
‫So you can get a rotator from a vector in C++ just by doing dot rotation like so.

37
00:02:28,850 --> 00:02:31,970
‫And that should be enough so we can put a semicolon on the end of the line.

38
00:02:31,970 --> 00:02:40,730
‫So all that remains is a mini challenge for you to fill out this particle system with something that

39
00:02:40,730 --> 00:02:42,830
‫we can configure in Blueprint.

40
00:02:43,750 --> 00:02:43,910
‫Okay.

41
00:02:43,990 --> 00:02:44,640
‫Welcome back.

42
00:02:44,650 --> 00:02:47,650
‫So we're going to essentially do what we did with the muzzle flash.

43
00:02:47,650 --> 00:02:49,000
‫So I'm going to copy that.

44
00:02:49,000 --> 00:02:53,830
‫You property here instead of the muzzle flash, we're going to have the impact effect.

45
00:02:55,030 --> 00:03:01,150
‫Like so and we're going to use that in your gameplay.

46
00:03:01,150 --> 00:03:02,860
‫Static spawn emitter at location.

47
00:03:02,860 --> 00:03:03,460
‫Cool.

48
00:03:03,460 --> 00:03:09,730
‫We're going to remove the draw debug point and we're going to have a go at compiling and playing.

49
00:03:10,520 --> 00:03:15,770
‫Once you've got that to compile successfully, we are going to go over to the content browser, open

50
00:03:15,770 --> 00:03:21,780
‫up our BP rifle because we need to attach a impact effect.

51
00:03:21,800 --> 00:03:23,840
‫Let's open up the full blueprint editor.

52
00:03:23,870 --> 00:03:24,890
‫Go to class defaults.

53
00:03:24,890 --> 00:03:26,490
‫Details impact effect.

54
00:03:26,510 --> 00:03:27,140
‫Let's look.

55
00:03:27,170 --> 00:03:28,850
‫See what we can find.

56
00:03:28,850 --> 00:03:29,870
‫Impact.

57
00:03:29,900 --> 00:03:30,920
‫See if we've got something.

58
00:03:30,920 --> 00:03:32,120
‫There I am.

59
00:03:33,560 --> 00:03:33,970
‫Nope.

60
00:03:33,980 --> 00:03:35,450
‫No, I am either.

61
00:03:35,450 --> 00:03:38,340
‫Maybe it's going to be called hit logo.

62
00:03:38,460 --> 00:03:41,840
‫We've got a Dre Wraith drone hit world.

63
00:03:41,850 --> 00:03:48,380
‫We've got a few different things down here and I think we can also choose some stuff from the shooter

64
00:03:48,380 --> 00:03:49,310
‫game asset pack.

65
00:03:49,310 --> 00:03:55,100
‫So if we go back to the content browser, asset packs, shooter game weapons, not weapons, sorry,

66
00:03:55,100 --> 00:04:03,020
‫the effects and then particle systems and then weapons, assault rifle impacts, who got the eye impact

67
00:04:03,020 --> 00:04:03,920
‫hit or something.

68
00:04:03,920 --> 00:04:06,560
‫So we can I think I'm going to be using that one.

69
00:04:06,740 --> 00:04:10,430
‫So I see what I'm going to search for assault rifle.

70
00:04:10,520 --> 00:04:12,050
‫That will be my impact effect.

71
00:04:12,050 --> 00:04:13,910
‫I quite liked that one in testing.

72
00:04:13,910 --> 00:04:20,920
‫So we're going to go alt p, but you can try out the other impact effects and try and hit a wall.

73
00:04:20,930 --> 00:04:21,260
‫There you go.

74
00:04:21,260 --> 00:04:25,850
‫When I hit the wall, you can see the impact effect being spawned off of it.

75
00:04:25,850 --> 00:04:28,070
‫So I'm very happy with that result.

76
00:04:28,460 --> 00:04:34,400
‫And the next lecture, we're going to be dealing damage to actors that we place around the world.

77
00:04:34,400 --> 00:04:35,120
‫Very exciting.

78
00:04:35,120 --> 00:04:36,470
‫So I will see you there.

