Gamepad | XBOX Controller

19 Aug

Implementing the control system

Every game needs, now and then, the input of the human player who intervenes in the world. On the PC, it can be the mouse in combination with the keyboard or you can connect your gamepad. On the mobile phone, the gamepad is simulated by inserting small “control sticks” on the left and right. If you have tried racing games or simply Brawlstars, you will notice that this type of control is disadvantageous. I won’t do without the “sticks”, but I wanted to try out whether I could integrate a gamepad into the game.

To do this, I first ordered a wireless adapter, which I ordered from Amazon at 7 p.m. in the evening and received the following day. The PC recognised it silently and I was able to pair my controller without any problems.

Unreal Engine Gamepad on PC

With just a few tests, I found out how to read out the left and right analogue stick and, because it was fun, I installed two buttons. A great sense of achievement. Within one evening, I had managed everything

But…

The sticks output analogue float values between -1.0 and 1.0, which are transferred into the movement of the character. However, if the stick remains in the neutral position, the input still delivers values that are not equal to 0.0, which means that the character always “slides” slightly. At the moment I help myself by only giving the values to the character when the value is outside of -0.025 and 0.025.
Let’s see if I can come up with something better.