WEBVTT

00:00.050 --> 00:00.470
Hello guys.

00:00.470 --> 00:01.430
Welcome to the video.

00:01.430 --> 00:04.790
In this one I want to show you how to add gamepad support.

00:04.790 --> 00:05.840
In general.

00:05.840 --> 00:08.030
It doesn't matter what type of gamepad you have.

00:08.030 --> 00:15.140
For example, I have new Xbox controller and PlayStation four DualShock controller and both of them

00:15.140 --> 00:16.220
are working fine.

00:16.670 --> 00:18.350
Let me switch on the gamepad.

00:20.840 --> 00:24.050
And you can see my joystick was connected and that is very good.

00:24.050 --> 00:27.620
So it means I have the gamepad connected to the unity.

00:27.620 --> 00:32.840
If you have a PlayStation controller, it's better to connect it with a cable because otherwise it may

00:32.840 --> 00:33.380
not connect.

00:33.380 --> 00:39.560
Now we need to go to player input over here and we need to add inputs for the gamepad.

00:41.040 --> 00:44.430
Let's add this up, down, left right composite.

00:44.820 --> 00:48.870
And over here we need to choose gamepad.

00:51.070 --> 00:53.080
And then we need to assign buttons for this.

00:53.080 --> 00:57.040
So for the app one we need to use stick up.

00:57.040 --> 00:59.200
Or if you want to use arrows you can use arrows.

00:59.200 --> 01:00.610
I'm just going to use the stick.

01:00.610 --> 01:04.900
And we can go to joystick and use uh up.

01:06.100 --> 01:08.200
Then let's go again here.

01:08.860 --> 01:09.820
Actually, we need to.

01:09.850 --> 01:10.120
Sorry.

01:10.120 --> 01:11.350
Let's be safe here.

01:11.350 --> 01:12.610
Let's use gamepad.

01:12.610 --> 01:16.900
And then we need to do left stick up.

01:16.990 --> 01:17.710
Okay.

01:18.270 --> 01:19.020
Then again.

01:19.020 --> 01:19.860
Over here again.

01:19.860 --> 01:20.610
Pad.

01:21.060 --> 01:22.440
Left stick.

01:23.250 --> 01:24.480
Uh, down.

01:27.150 --> 01:28.470
Then left.

01:28.470 --> 01:29.580
GamePad.

01:29.580 --> 01:34.350
Let's go down, left, stick, left and gamepad.

01:36.910 --> 01:37.780
Left stick.

01:37.780 --> 01:38.410
Right.

01:38.410 --> 01:39.790
Okay, now for the jump.

01:39.790 --> 01:41.110
We're going to need a button.

01:41.110 --> 01:43.810
So we're going to do add binding.

01:44.140 --> 01:46.570
This will be gamepad.

01:46.570 --> 01:48.400
And here you need to choose a button.

01:48.400 --> 01:50.980
And luckily for us you can see they've been very smart.

01:50.980 --> 01:56.920
And they just did it as east North South and West button which allows you to set this up for any controller

01:56.920 --> 01:57.970
you're going to have.

01:57.970 --> 02:01.450
And for the jump I want to use the source button.

02:01.450 --> 02:08.920
If you want to use a on a Xbox controller or X on the PlayStation controller, the source one.

02:09.370 --> 02:12.490
And let's just add this as a gamepad.

02:12.490 --> 02:13.420
Very nice.

02:13.420 --> 02:18.100
And just in case, I'll add another button, because sometimes I like to press different button for

02:18.100 --> 02:18.850
no reason.

02:18.850 --> 02:23.080
I'm going to do gamepad and I'm going to use the west button as well.

02:23.080 --> 02:27.760
So it's like square on a PlayStation controller or X on a Xbox controller.

02:28.740 --> 02:30.870
For the polls over here.

02:30.870 --> 02:32.790
Let's add binding.

02:33.270 --> 02:35.400
Add binding I'm going to use.

02:35.910 --> 02:37.740
Start button on a gamepad.

02:37.740 --> 02:43.950
You can just type start over there and it's going to open the polls menu and do a gamepad over here

02:43.950 --> 02:45.090
and here.

02:45.960 --> 02:46.980
And here.

02:46.980 --> 02:47.610
Okay.

02:47.610 --> 02:48.630
This should be good.

02:48.630 --> 02:51.930
Let's do save asset and.

02:53.640 --> 02:57.390
And believe me or not, because we did other functionality, that's all what we need to do.

02:57.540 --> 03:03.240
Now I can go to play mode, I can take my controller and I can walk around and jump.

03:05.970 --> 03:06.240
Yeah.

03:06.240 --> 03:08.820
You see how easy it was to set up with a new input system?

03:09.780 --> 03:13.680
We only had to spend a little bit of a time to do it in the previous video.

03:13.680 --> 03:15.750
By the way, it's so much fun with the controller.

03:16.710 --> 03:17.490
Whoa.

03:17.490 --> 03:20.700
Maybe I should make some levels and publish the game.

03:21.600 --> 03:22.380
Yeah.

03:24.680 --> 03:26.900
Okay, let's stop playing.

03:27.590 --> 03:30.380
That's all what we had to do in this video, just in case.

03:30.380 --> 03:33.380
I'll check this with the PlayStation controller, but it should be fine.

03:34.280 --> 03:35.150
Let me open console.

03:35.150 --> 03:36.740
Let me join the gamepad.

03:40.980 --> 03:42.960
Was connected very good.

03:42.960 --> 03:47.070
And I can walk and I can jump with two different buttons.

03:47.070 --> 03:47.970
Perfect.

03:48.330 --> 03:51.270
Now let's finish this video and let's go to the next one.

03:51.270 --> 03:53.100
We still need to do some work here.
