Search Unity

Player keep going right

Discussion in 'Getting Started' started by Eltom10e, Apr 8, 2021.

  1. Eltom10e

    Eltom10e

    Joined:
    Apr 8, 2021
    Posts:
    3
    Hello,

    I've tried to start the unity tuto but when i test the game it's like the "d" button is permanently pushed, resulting in my player or kart keep going right.

    I've tried with lego and fps microgame with unity version 2019.4.23f1.

    Any advice ?
     
  2. L_stro

    L_stro

    Joined:
    Mar 13, 2021
    Posts:
    4
    Do you know the corresponding place in code? You could share it here. Does the error occur directly after starting the game or after hitting the "d" button once?
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I bet you have a game controller plugged in, and your code is set to make the character go right whenever the analog input is even a little bit > 0.
     
    Ryiah, Peeter1978 and Joe-Censored like this.
  4. Eltom10e

    Eltom10e

    Joined:
    Apr 8, 2021
    Posts:
    3
    Thanks for your answers,

    The issue occurs directly after starting the game, i unplugged my controller and same issue.
    I do not know the corresponding place in code as i am at my really debut, but i changed nothing and it's the default microgamme by unity.
     
  5. BenniKo

    BenniKo

    Joined:
    Mar 24, 2015
    Posts:
    100
    You could test your joypad online via https://greggman.github.io/html5-gamepad-test/
    This will show you if for some reason your joypad is pushing to the right.
    This Gamecontroller also shows virtual joypads which you might have installed accidently with some other software.

    If that is all good then the actual code of your project is the problem.
    You need to find the script that reads from the controller's axis.
     
    JoeStrout likes this.
  6. Eltom10e

    Eltom10e

    Joined:
    Apr 8, 2021
    Posts:
    3
    You found it! thank you, with this site i could see that i add i virtual joypad, i removed it and know it's godd, thanks y'all.