Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,140 --> 00:00:04,280
In this video, we're going to implement the iconic jump from Mega man and Mega man clones.
2
00:00:04,280 --> 00:00:08,240
Again, our goal isn't to simply copy Mega man, but just be inspired by it.
3
00:00:08,240 --> 00:00:11,180
And this is kind of a big part that makes the game work.
4
00:00:11,180 --> 00:00:14,210
If we only press the button a little bit, we just get a short hop.
5
00:00:14,210 --> 00:00:17,000
But if we hold the button, we get a very long jump.
6
00:00:17,000 --> 00:00:22,310
And to do that, we first want to worry about the short hop and adjust the gravity accordingly.
7
00:00:22,310 --> 00:00:28,400
In the last video, we already set the gravity to three to make it a lot heavier, and this is the value
8
00:00:28,400 --> 00:00:29,450
used for most platformers.
9
00:00:29,450 --> 00:00:33,560
But in this case, again, we actually want to make it even higher so we can have this short hop and
10
00:00:33,560 --> 00:00:34,550
the long jump.
11
00:00:34,550 --> 00:00:38,060
And the value that I found works best is 5.5.
12
00:00:38,060 --> 00:00:41,420
And if we just go back now, you can see we get this very short hop.
13
00:00:41,420 --> 00:00:44,780
But even now this is a little bit too high for the short hop I want to have.
14
00:00:44,780 --> 00:00:50,480
So we can again go to Jump Velocity and set it a little bit lower to 600.
15
00:00:50,810 --> 00:00:51,830
Like this.
16
00:00:52,580 --> 00:00:57,110
And this gives us this very short hop that I want the players to be able to use if they want to have
17
00:00:57,110 --> 00:00:58,760
very precise platforming.
18
00:00:58,760 --> 00:01:04,190
Next up, we want to implement the max hold time, and this is something we don't want the enemies to
19
00:01:04,190 --> 00:01:04,700
have.
20
00:01:04,700 --> 00:01:09,290
So now we can just compile and save this action to our base, and the rest we're going to implement
21
00:01:09,290 --> 00:01:10,160
in the player.
22
00:01:10,160 --> 00:01:16,400
So in the BP player, we can then again go to the viewport just to look at the player.
23
00:01:16,400 --> 00:01:22,460
And this setting is actually not on the character movement component but it is on the character.
24
00:01:22,460 --> 00:01:26,780
So here on the base we can look for max hold time.
25
00:01:27,330 --> 00:01:32,220
And this defines how long you're allowed to hold the jump button and still get momentum out of it.
26
00:01:32,220 --> 00:01:35,910
And the value that I found best here is 0.4.
27
00:01:36,450 --> 00:01:37,800
Let's try this out.
28
00:01:37,800 --> 00:01:41,310
And now if I press the button we always get this long jump.
29
00:01:41,310 --> 00:01:46,920
We actually aren't able to pick between the short hop and the long jump, even if we let go of the button
30
00:01:46,920 --> 00:01:47,700
early.
31
00:01:47,700 --> 00:01:50,160
So to fix that we have to go to the BP player.
32
00:01:50,160 --> 00:01:54,390
And on the event graph we have to look for our AI, a jump.
33
00:01:54,390 --> 00:01:58,740
And actually we need to stop jumping not just from canceled but also from completed.
34
00:01:58,740 --> 00:02:00,030
So completed triggers.
35
00:02:00,030 --> 00:02:07,350
If we let go of the button and it will trigger the stop jumping now so we can go here and now I can
36
00:02:07,350 --> 00:02:08,880
just hold the button for a little bit.
37
00:02:08,880 --> 00:02:12,990
I get this short hop if I hold it for a long time, we get this very long jump.
38
00:02:12,990 --> 00:02:16,800
And this is a very distinct feature of these kind of games that give you a lot of air control.
39
00:02:17,370 --> 00:02:19,980
But the air control still feels kind of weird.
40
00:02:19,980 --> 00:02:23,340
We can kind of jump in one direction, but we just keep on drifting.
41
00:02:23,340 --> 00:02:32,130
So on the player now VP player on the character movement component, we now want to again set our air
42
00:02:32,130 --> 00:02:33,000
control.
43
00:02:33,000 --> 00:02:36,270
And this time we actually want to go full 1.0.
44
00:02:36,540 --> 00:02:37,830
Just compile and save.
45
00:02:37,830 --> 00:02:40,740
And this gives us more air control.
46
00:02:40,740 --> 00:02:45,540
But it still doesn't let us just move left and right how we want.
47
00:02:45,540 --> 00:02:48,030
Which again is a feature of these kind of games.
48
00:02:48,030 --> 00:02:52,770
We can just kind of keep on drifting in one direction and we have to like fight against the momentum
49
00:02:52,770 --> 00:02:53,910
we already have.
50
00:02:53,910 --> 00:02:58,380
But in this case, we want to be able to freely just go left and right while we're jumping.
51
00:02:58,380 --> 00:03:00,780
And again, there is a simple setting for this.
52
00:03:00,780 --> 00:03:02,130
On the VP player.
53
00:03:02,130 --> 00:03:06,930
On the movement component we can look for lateral friction.
54
00:03:06,930 --> 00:03:12,240
So the higher this value is, the easier it lets us fight against the momentum that we already have
55
00:03:12,240 --> 00:03:13,020
in the air.
56
00:03:13,500 --> 00:03:18,720
And again I've been playing around with these values and 50 is the one that I came up with that felt
57
00:03:18,720 --> 00:03:19,470
about right.
58
00:03:19,920 --> 00:03:21,990
So compile and save and go in here.
59
00:03:21,990 --> 00:03:25,590
And now I can just freely move left and right while in the air.
60
00:03:26,290 --> 00:03:31,840
Right, like I can go right and then steer against it and immediately move in the other direction,
61
00:03:31,840 --> 00:03:34,840
which makes for very precise platforming controls.
62
00:03:34,840 --> 00:03:38,200
And when it comes to the character movement, we still have the wall slide left to do.
63
00:03:38,230 --> 00:03:43,390
We have the ground slide left to do, but I believe the projectiles and the shooting is more important,
64
00:03:43,390 --> 00:03:47,170
so I want to cover that first, and that's what we're going to do in the next video.
6351
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.