Hello guys.
Welcome to the video.
In this one I want to show you how to add gamepad support.
In general.
It doesn't matter what type of gamepad you have.
For example, I have new Xbox controller and PlayStation four DualShock controller and both of them
are working fine.
Let me switch on the gamepad.
And you can see my joystick was connected and that is very good.
So it means I have the gamepad connected to the unity.
If you have a PlayStation controller, it's better to connect it with a cable because otherwise it may
not connect.
Now we need to go to player input over here and we need to add inputs for the gamepad.
Let's add this up, down, left right composite.
And over here we need to choose gamepad.
And then we need to assign buttons for this.
So for the app one we need to use stick up.
Or if you want to use arrows you can use arrows.
I'm just going to use the stick.
And we can go to joystick and use uh up.
Then let's go again here.
Actually, we need to.
Sorry.
Let's be safe here.
Let's use gamepad.
And then we need to do left stick up.
Okay.
Then again.
Over here again.
Pad.
Left stick.
Uh, down.
Then left.
GamePad.
Let's go down, left, stick, left and gamepad.
Left stick.
Right.
Okay, now for the jump.
We're going to need a button.
So we're going to do add binding.
This will be gamepad.
And here you need to choose a button.
And luckily for us you can see they've been very smart.
And they just did it as east North South and West button which allows you to set this up for any controller
you're going to have.
And for the jump I want to use the source button.
If you want to use a on a Xbox controller or X on the PlayStation controller, the source one.
And let's just add this as a gamepad.
Very nice.
And just in case, I'll add another button, because sometimes I like to press different button for
no reason.
I'm going to do gamepad and I'm going to use the west button as well.
So it's like square on a PlayStation controller or X on a Xbox controller.
For the polls over here.
Let's add binding.
Add binding I'm going to use.
Start button on a gamepad.
You can just type start over there and it's going to open the polls menu and do a gamepad over here
and here.
And here.
Okay.
This should be good.
Let's do save asset and.
And believe me or not, because we did other functionality, that's all what we need to do.
Now I can go to play mode, I can take my controller and I can walk around and jump.
Yeah.
You see how easy it was to set up with a new input system?
We only had to spend a little bit of a time to do it in the previous video.
By the way, it's so much fun with the controller.
Whoa.
Maybe I should make some levels and publish the game.
Yeah.
Okay, let's stop playing.
That's all what we had to do in this video, just in case.
I'll check this with the PlayStation controller, but it should be fine.
Let me open console.
Let me join the gamepad.
Was connected very good.
And I can walk and I can jump with two different buttons.
Perfect.
Now let's finish this video and let's go to the next one.
We still need to do some work here.