1
00:00:03,190 --> 00:00:08,010
In this lecture, we're going to be setting up a machine flow camera so that we can finally run around

2
00:00:08,029 --> 00:00:10,060
all the different parts of our level.

3
00:00:10,090 --> 00:00:13,900
We've set up a machine before in the course, so if you already know how to do it and you want to try

4
00:00:13,930 --> 00:00:15,760
doing this on your own, there's the challenge for you.

5
00:00:15,760 --> 00:00:16,840
Jump in and do that.

6
00:00:16,840 --> 00:00:20,170
If you want to do this together, then let's jump in and take it on together.

7
00:00:20,170 --> 00:00:23,740
And I open up the package manager and search for center machine.

8
00:00:23,740 --> 00:00:27,880
Maybe we can do this as a little bit of a race to see whether you can set up your center machine, follow

9
00:00:27,880 --> 00:00:29,110
camera before I can.

10
00:00:29,110 --> 00:00:32,220
So consider that a challenge, a duel.

11
00:00:32,229 --> 00:00:33,610
I'm laying down the gauntlet.

12
00:00:33,610 --> 00:00:36,340
I'm installing a machine from the package manager.

13
00:00:36,340 --> 00:00:40,960
If you currently don't have it installed in your project, you'll need to do the same and I'll leave

14
00:00:40,960 --> 00:00:42,340
this whole stuff going on.

15
00:00:42,340 --> 00:00:46,510
So if we are doing this as a race, if you're saying I'm going to set up my set of machine quicker than

16
00:00:46,510 --> 00:00:49,630
Rick, maybe it's dependent upon how quick your computer is.

17
00:00:49,630 --> 00:00:56,650
And my computer, while we wait for all these aspects to load and install mine is now finished.

18
00:00:56,650 --> 00:00:57,130
Awesome.

19
00:00:57,130 --> 00:00:58,840
You can see the remove button in there.

20
00:00:58,840 --> 00:01:04,870
Should be there if it's all done and dusted and click back on my scene view so I can see what's happening

21
00:01:04,870 --> 00:01:05,410
now.

22
00:01:05,410 --> 00:01:10,600
I'm going to right click in my hierarchy, create a machine, virtual camera.

23
00:01:10,600 --> 00:01:15,280
I'm going to rename this to be, say, follow camera.

24
00:01:16,270 --> 00:01:17,830
You can name yours whatever you like.

25
00:01:17,830 --> 00:01:18,520
I'm going to drag it.

26
00:01:18,520 --> 00:01:23,410
So it sits generally underneath the main camera in that ballpark, not as a child just next to it.

27
00:01:23,410 --> 00:01:28,450
And the follow camera I'm going to click on and I'm going to change the body to be a framing transfer

28
00:01:28,470 --> 00:01:28,960
user.

29
00:01:28,960 --> 00:01:32,380
And I'm going to follow click on the little selector on follow.

30
00:01:32,470 --> 00:01:34,000
We'll follow the player.

31
00:01:34,030 --> 00:01:39,160
Now if I click on play and click on the game window should automatically go to the game window.

32
00:01:39,160 --> 00:01:40,660
You can see that we're running around.

33
00:01:40,660 --> 00:01:41,110
So there we go.

34
00:01:41,140 --> 00:01:41,830
It's in a machine.

35
00:01:41,830 --> 00:01:43,900
Job done well, mostly job done.

36
00:01:43,900 --> 00:01:48,190
What I'd like to do is tweak it a little bit so you can see it's quite an aggressive follow at the moment

37
00:01:48,190 --> 00:01:49,450
as we jump up and down.

38
00:01:49,450 --> 00:01:50,650
I think that's a little bit annoying.

39
00:01:50,650 --> 00:01:52,030
I want to soften that.

40
00:01:52,030 --> 00:01:53,170
I can change the dampening.

41
00:01:53,170 --> 00:01:55,180
I'm also going to change the dead zone.

42
00:01:55,180 --> 00:02:00,310
So let's see side note if we're having a race, this is probably the point where if you finished, then

43
00:02:00,310 --> 00:02:01,780
cool, we've finished the race.

44
00:02:01,780 --> 00:02:04,870
I'm now going to tweak it a little bit and see what we can do.

45
00:02:04,870 --> 00:02:07,930
If we make the changes while we're in play mode, then we keep them.

46
00:02:07,930 --> 00:02:10,360
It's not a case that we lose them when we get out of play mode.

47
00:02:10,360 --> 00:02:12,790
So I'm just going to increase the dead zone width.

48
00:02:12,790 --> 00:02:17,500
You can see there it makes these lines open up a little bit and the dead zone height as well.

49
00:02:17,500 --> 00:02:20,590
What that does is let me just make this more pronounced.

50
00:02:20,620 --> 00:02:25,300
It means that I can run in that area and the camera won't move at all until I get to the edge of the

51
00:02:25,300 --> 00:02:25,840
area.

52
00:02:25,840 --> 00:02:27,490
Then it will start to move again.

53
00:02:27,490 --> 00:02:31,450
I don't want to have it quite so wide, but we want to have a little bit in there, I think a little

54
00:02:31,450 --> 00:02:36,610
bit of say 0.1 and probably 0.1 as well on the height.

55
00:02:36,610 --> 00:02:39,310
Now, the height, as I mentioned before, is a little bit more aggressive than I want.

56
00:02:39,340 --> 00:02:41,320
So I'm going to change the Y dampening.

57
00:02:41,320 --> 00:02:47,020
Might pop it up to say five, see how that works so that when you jump up and down, it slowly tries

58
00:02:47,020 --> 00:02:48,160
to find the player again.

59
00:02:48,160 --> 00:02:53,650
It's not going don't really quickly and but I think it's okay to go very quickly on the X and the Y

60
00:02:53,650 --> 00:02:55,150
to try to catch up to the player.

61
00:02:55,150 --> 00:02:56,470
You can see the yellow dot.

62
00:02:56,470 --> 00:02:58,180
There is what the camera is trying to say.

63
00:02:58,210 --> 00:03:03,340
Keep that dot within the framing of what's our dead zone area.

64
00:03:03,340 --> 00:03:06,190
So if we get out of the dead zone, then bring the dead zone up to it.

65
00:03:06,190 --> 00:03:07,090
So it's touching it.

66
00:03:07,570 --> 00:03:08,170
So there we go.

67
00:03:08,170 --> 00:03:09,670
That's pretty much all I wanted to do.

68
00:03:09,670 --> 00:03:12,850
I might play around in the future with the lens ortho size.

69
00:03:12,850 --> 00:03:14,620
That's how you move the camera in and out.

70
00:03:14,620 --> 00:03:19,450
You can see the camera distance here doesn't do anything because we're currently framed on the player.

71
00:03:19,450 --> 00:03:24,010
We're using this framing transpose, but if I change the ortho size, I could move back a little bit

72
00:03:24,010 --> 00:03:27,610
if I wanted to have more level and less player or moving closer.

73
00:03:27,610 --> 00:03:32,620
If I wanted to get closer relationship to the personality of the player, I'm going to leave it as the

74
00:03:32,620 --> 00:03:37,210
default five for now until I have more gameplay in my game and see what I might actually need.

75
00:03:37,210 --> 00:03:37,870
But there we go.

76
00:03:37,900 --> 00:03:41,770
That's setting up the basics of our center machine for the camera.

