1
00:00:03,100 --> 00:00:03,950
Welcome back.

2
00:00:03,969 --> 00:00:05,230
Our projects coming along well.

3
00:00:05,230 --> 00:00:07,030
We have a bowl instead of a bowl.

4
00:00:07,030 --> 00:00:09,130
I want to have an actual snowboarder in there.

5
00:00:09,130 --> 00:00:13,240
First of all, what I'm going to do is click on the bowl and rename it from bowl to Barry, because

6
00:00:13,240 --> 00:00:16,990
that's who I decided the player would be called and I'm going to change it.

7
00:00:16,990 --> 00:00:18,580
So it looks like a Barry.

8
00:00:18,580 --> 00:00:23,710
And I've given you in the download that we had a few lectures back, given you some assets, the top

9
00:00:23,710 --> 00:00:27,490
and the bottom of the snowboarder, and we're going to replace our ball with the snowboarder, but I'm

10
00:00:27,490 --> 00:00:29,710
going to see how you go with this as a challenge.

11
00:00:29,710 --> 00:00:31,150
So the challenge is to add a character.

12
00:00:31,150 --> 00:00:36,790
You can either use our character or you can download or even make your own character if your heart desires.

13
00:00:36,790 --> 00:00:42,100
I'd like you to add the character in place of the ball and to have a try at adding the components you

14
00:00:42,100 --> 00:00:45,790
think that our character needs so that it's ready to be a snowboarder.

15
00:00:45,790 --> 00:00:46,300
So there you go.

16
00:00:46,300 --> 00:00:47,680
The easy challenge plus video.

17
00:00:47,710 --> 00:00:49,030
I'll see you back here when you're done.

18
00:00:51,390 --> 00:00:52,560
Now let's click on Barry.

19
00:00:52,590 --> 00:00:55,900
What is it that makes Barry look like a circle or look like a ball?

20
00:00:55,930 --> 00:01:01,380
It's because we have this sprite renderer with a circle in there, so I'm going to remove that component.

21
00:01:01,380 --> 00:01:07,140
Now we can see that we've got collision on there, but we don't have the we're not rendering the particular

22
00:01:07,260 --> 00:01:07,800
the ball.

23
00:01:07,800 --> 00:01:08,660
We're not seeing the ball.

24
00:01:08,670 --> 00:01:12,360
I also don't want the Circle Collider because Barry is shaped a little bit different to that.

25
00:01:12,360 --> 00:01:15,210
So I'm going to right click remove that component as well.

26
00:01:15,210 --> 00:01:18,120
So now we just have an empty thing with a rigid body on it.

27
00:01:18,120 --> 00:01:18,540
That's cool.

28
00:01:18,540 --> 00:01:19,650
We need a rigid body.

29
00:01:19,650 --> 00:01:20,820
We'll leave that there.

30
00:01:20,820 --> 00:01:28,290
What I'm going to do is to drag in the bottom of Barry so that he's a child underneath the Barry parent.

31
00:01:28,290 --> 00:01:33,450
We've talked about this a little bit, but essentially what's that saying is the parent game object

32
00:01:33,480 --> 00:01:35,100
has a location in the world.

33
00:01:35,100 --> 00:01:37,620
You can see -6.3, 1.4, three.

34
00:01:37,620 --> 00:01:38,700
That's where it is in the world.

35
00:01:38,700 --> 00:01:45,180
If I was to click W and move that around, you can see that the position of the Barry game object,

36
00:01:45,180 --> 00:01:49,830
the parent game object, parent of the high level children underneath is going to move around.

37
00:01:49,830 --> 00:01:50,430
That's cool.

38
00:01:50,430 --> 00:01:54,660
But we've got a problem here that this is the middle of Barry and these are his legs all the way over

39
00:01:54,660 --> 00:01:54,840
here.

40
00:01:54,840 --> 00:01:59,160
If we click on the child, you can see that the child also has a position.

41
00:01:59,160 --> 00:02:04,050
The position of children in game objects is relative to the parent.

42
00:02:04,050 --> 00:02:10,259
So if I put this at zero on the X and zero on the Y, the legs will be right underneath where the Barry

43
00:02:10,259 --> 00:02:11,700
parent game object is.

44
00:02:11,700 --> 00:02:18,390
And then if I go and move the Barry parent game object to say Y is higher, you can see it moves the

45
00:02:18,390 --> 00:02:19,470
legs as well.

46
00:02:19,470 --> 00:02:23,580
So it's just important to note if you're having an issue with things not being in the right place,

47
00:02:23,730 --> 00:02:27,240
maybe it's because your children aren't zeroed in.

48
00:02:27,240 --> 00:02:30,300
And we'll change this in a moment because we need do a little bit of moving around in here.

49
00:02:30,300 --> 00:02:33,270
But you want it mostly right underneath where the parent is.

50
00:02:33,270 --> 00:02:38,160
Next I'll grab the border top, drag that over onto the Barry game object as well.

51
00:02:38,160 --> 00:02:39,330
I'm just going to reorder them.

52
00:02:39,330 --> 00:02:41,400
Just drag this up and see the little blue line there.

53
00:02:41,400 --> 00:02:46,920
If I drag it above border bottom, it will be above allows to drag something and you can see it goes

54
00:02:46,920 --> 00:02:47,430
gray.

55
00:02:47,430 --> 00:02:50,640
That's going to make it a child underneath that other game object.

56
00:02:50,640 --> 00:02:54,150
So this is a child under a child under a child, a grandchild, if you will.

57
00:02:54,570 --> 00:02:58,980
If I drag it back up, get the blue line, and then you can see it will be at the same order.

58
00:02:58,980 --> 00:03:01,290
The indentation shows the order of the parenting.

59
00:03:01,290 --> 00:03:03,390
Now the top is way off over there as well.

60
00:03:03,390 --> 00:03:06,480
Once again, if I was to move Barry around, it'll move both these pieces.

61
00:03:06,480 --> 00:03:12,870
But we want to get the top by clicking on the top and click on W and move it over to roughly where the

62
00:03:12,870 --> 00:03:13,740
bottom is.

63
00:03:13,740 --> 00:03:18,570
Now if we click back on Barry, you can see the center of the overall game object, the bottom and the

64
00:03:18,570 --> 00:03:21,480
top is around the bottom ish of our object.

65
00:03:21,480 --> 00:03:24,630
And when we rotate, it's going to rotate around this pivot point.

66
00:03:24,630 --> 00:03:29,970
So what I could do is grab the top and the bottom just by clicking shift and then my left mouse button.

67
00:03:29,970 --> 00:03:32,370
So now I'm moving the children game objects.

68
00:03:32,370 --> 00:03:34,470
I'm going to move them down a little bit.

69
00:03:34,470 --> 00:03:39,600
Then when I click back on Barry, you can see the middle of Barry or where Barry the parent is in the

70
00:03:39,600 --> 00:03:44,340
world in relation to where the children are or the children are kind of right in the middle of where

71
00:03:44,340 --> 00:03:46,140
the parent is, which is pretty good.

72
00:03:46,140 --> 00:03:48,840
I just need to move the top a tiny bit, so it lines up.

73
00:03:48,840 --> 00:03:50,940
Now, if we were to click on play, what's going to happen?

74
00:03:50,940 --> 00:03:54,210
I have a feeling Barry's going to not behave well.

75
00:03:54,570 --> 00:03:56,970
We'll just float down behind the world.

76
00:03:56,970 --> 00:04:01,020
One thing I noticed just then is Barry went behind the world when he dropped around behind.

77
00:04:01,020 --> 00:04:05,400
So I'm going to click on board top and shift and click again to get both of them order in.

78
00:04:05,400 --> 00:04:10,290
Later, I'm going to put this at, say, ten so that he's always appearing over the top of the world.

79
00:04:10,290 --> 00:04:12,570
He's not going to float around beside the back of it.

80
00:04:12,570 --> 00:04:14,520
I think that's going to look a little bit nicer now.

81
00:04:14,520 --> 00:04:22,680
The next thing I want to do is to give Barry some collision so that the board actually touches our world.

82
00:04:22,680 --> 00:04:28,110
And it's a little bit finicky to do this because you can see our board is slightly rotated.

83
00:04:28,110 --> 00:04:33,690
So I'm going to just well, I've got my top and bottom selected, just hit E and rotate everything so

84
00:04:33,690 --> 00:04:36,210
that it is as straight as possible.

85
00:04:36,240 --> 00:04:42,300
Because now when I click on Barry, I'm going to add a collider at this top parent level and let me

86
00:04:42,300 --> 00:04:42,720
show you that.

87
00:04:42,720 --> 00:04:47,640
So if we click on Barry, we add component, I'm going to add a capsule collider to DH.

88
00:04:47,670 --> 00:04:49,170
I can modify this pretty easily.

89
00:04:49,170 --> 00:04:54,990
I first of all want to make it a horizontal so it's a lefty righty instead of an down e and the size

90
00:04:54,990 --> 00:04:57,870
of this, let's see, the Y is to fat.

91
00:04:57,870 --> 00:05:03,750
I'm going to move the x wider and the Y a little bit smaller so you can see it's a little bit thinner.

92
00:05:03,750 --> 00:05:05,550
I'm just going to make it the same shape as a snowboard.

93
00:05:05,550 --> 00:05:10,680
Now I can on the Y offset, you can see over here on the right under capsule collider I'm just moving

94
00:05:10,680 --> 00:05:13,650
the size and the offset by mousing over the letters.

95
00:05:13,650 --> 00:05:14,610
I'm going to mouse down there.

96
00:05:14,610 --> 00:05:17,640
So it's a roundabout where the bottom of our snowboard is now.

97
00:05:17,640 --> 00:05:18,690
It's all lined up nicely.

98
00:05:18,690 --> 00:05:24,540
And like I say, the collider is at the Barry level, whereas the graphics are at the child level.

99
00:05:24,540 --> 00:05:26,610
So parent and children relationship there.

100
00:05:26,610 --> 00:05:30,810
Now when I click on play, I'm expecting that Bauer is going to go up and just slide down the hill.

101
00:05:30,810 --> 00:05:32,880
Well, he did go boop, but he didn't slide.

102
00:05:32,880 --> 00:05:33,570
And why is that?

103
00:05:33,570 --> 00:05:39,300
Well, that's because the amount of gravity that's pushing down on Barry and the friction isn't enough

104
00:05:39,300 --> 00:05:40,920
for it to slide along with this capsule.

105
00:05:40,920 --> 00:05:45,870
Collider And that's okay because we're not going to try to push our snowboarder along using just plain

106
00:05:45,870 --> 00:05:47,970
old gravity, because then what's going to happen?

107
00:05:47,970 --> 00:05:50,460
Well, down the hill it'll pick up speed and then up the hill.

108
00:05:50,580 --> 00:05:51,480
To go very slow.

109
00:05:51,480 --> 00:05:53,790
It makes it difficult for us to have a consistent game.

110
00:05:53,790 --> 00:05:59,010
So the way we're going to resolve that is by using effectors, which we're going to do in the next lecture.

111
00:05:59,010 --> 00:06:02,670
And the one last thing I'll do while I'm here is I know that at some point we want Barry to be out of

112
00:06:02,670 --> 00:06:06,540
crash, so we need a different sort of collision detection to do that.

113
00:06:06,540 --> 00:06:08,190
So I'm going to click on Barry once again.

114
00:06:08,190 --> 00:06:12,600
It's going to roll up a couple of these for the moment, just so I can see add component and we'll add

115
00:06:12,600 --> 00:06:14,550
a collider to DH.

116
00:06:14,580 --> 00:06:15,150
What should we add?

117
00:06:15,150 --> 00:06:17,310
We'll add a circle collider to dates right in the middle of it.

118
00:06:17,400 --> 00:06:24,480
Once again, we can modify this by clicking on our radius and making it smaller and then our offset

119
00:06:24,480 --> 00:06:26,940
to move it up a little bit and to the right a little bit.

120
00:06:26,940 --> 00:06:33,480
And I'm going to put this right over the top of his noggin to say, if you bump your head, then bad

121
00:06:33,480 --> 00:06:34,290
things are going to happen.

122
00:06:34,290 --> 00:06:38,670
So we won't use this just yet, but we've got this here for when we do want to set it up so that when

123
00:06:38,670 --> 00:06:41,100
you do bump into something, we can set this up as a trigger.

124
00:06:41,100 --> 00:06:43,530
You know, I might even just click on trigger at the moment.

125
00:06:43,530 --> 00:06:47,640
So we've got this trigger volume on his head for in future lectures where we want to have it so that

126
00:06:47,640 --> 00:06:48,900
he can actually crash.

127
00:06:48,900 --> 00:06:49,530
So there we go.

128
00:06:49,560 --> 00:06:50,520
That's all I wanted to do here.

129
00:06:50,520 --> 00:06:52,800
We've talked a little bit about parent child relationship.

130
00:06:52,800 --> 00:06:57,720
We've got Barry, our snowboarder, set up with his graphics, all nicely aligned.

131
00:06:57,720 --> 00:07:02,880
We've got some collision under the snowboard so that he can actually start moving along, colliding

132
00:07:02,880 --> 00:07:04,800
with our world in the right place.

133
00:07:04,800 --> 00:07:05,610
So good stuff.

134
00:07:05,610 --> 00:07:07,320
I will see you in the next lecture.

