- Home /
Gamepad axis as getbuttondown
Hi guys!
I'm trying to use a gamepad in my game, but I can't figure out a way to use the gamepad axis as a button down. When I use GetAxisRaw the game itself will behave as if it has multiple button presses and I only want one.
Right now I have this piece of code:
if (Input.GetButtonDown("P2 Left"))
{
Move_Left();
}
else if (Input.GetButtonDown("P2 Right"))
{
Move_Right();
}
How can I do this with the gamepad axis?
Tnks for the help guys!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612044022im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Creating a menu for gamepad? 1 Answer
Unity Editor swallows gamepad input 0 Answers