A simple way to input GamePad

Hello Every one.
To Add gamePad implementation,just add a new binding by pushing + on the CameraMovement:

In the new binding choose GamePad and then the stick you want.
For me D-Pad but it works with the two others.

Save and it’s done.

If you want to add a more elaborated implementation to move the screen by example keep the right mouse button pressed and moving the mouse (like in some game), add another new binding by the same way see before and here choose One modifier option this time:

In the first field, the modifier one, choose Mouse in the path option:

and then choose the right button:

Then in the blank binding field above the modifier, choose Delta :

Now you are able to move the screen by right clicking and move the mouse :slight_smile:

For the rotation with the gamePad, you can imagine to rotate by pressing right or left with the left stick.
For that add a new Add Positive/negative Binding exactly the same as in the course.
For the negative path choose Gamepad then the Right Right Stick

Now you can rotate the camera by pushing right or lrft Right stick.

If you want the player would be able to rotate by the mouse, for example by Middle pressing and left and right moving the mouse do the exactly same thing than for moving with the game pad.
Add a binding with one modifier.
In modifier choose this time the mouse then the middle button

then in the binding blank field under the modifier select mouse and Delta X

Now you can rotate the camera by pressing middle button and moving the mouse on left and right :slight_smile:

In the same spirit, another way to zoom with the mouse is Middle clicking and move the mouce up and down.

As would the The master 'super easy" :slight_smile:

In the CameraZoomAction add another “Add a binding with one modifier”.
In modifier select Mouse then middle button.
And in the Binding field choose mouse and then Delta Y this time.

For the zoom with the gamepad, “Super easy” too.
Add a new " Add Positive/negative Binding".
In the negative one, if you have chosen the Right stick left and right for rotate, you can now by the same way choose the up and down for the right stick.

Now you are able to zoom with the right stick with your gamePAd :slight_smile:

To add another option with south button (A button) to select something, you can add another Binding in the Click field and this time select GamePad and the SouthButton.

Now you are able to select by pushing A or green button as you do with the mouse.

I’m trying to find how to replace mouse movement by the LeftStick movement but it looks hardest.
If something know the way to do, I open :slight_smile:

Hoping it helps.




Since every action is based on a grid position you could easily have a focus object wandering on the grid positions and using different buttons for “clicking” on either the field or a unit or interactable on the field…

That would be a bit like I had previously done in a less refined way on some jam games:

Privacy & Terms