Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Left arrow key "stuck" in Unity

Discussion in 'Editor & General Support' started by ziipzoop, Jun 5, 2016.

  1. ziipzoop

    ziipzoop

    Joined:
    Jun 5, 2016
    Posts:
    3
    When I play a scene in the Unity editor Unity thinks my left arrow key is constantly pressed for some reason. The same happened in two games I played that I suppose have been made with Unity.

    Logitech PS2 keyboard, latest drivers
     
  2. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    It's funny that I read this because this has happened to me a few times.
    It happens if I pause the playmode and manually move the character inside a collider.
    Then unpausing the game, the character gets "pushed" out of the collider, but then character continues moving in the same direction that it was "pushed" for the rest of the game and can't be stopped.
    I don't know if it has anything to do with the input from the keyboard though.
     
  3. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Odd... I might try this for lols! XD

    I assume you guys are using 5.x.
     
  4. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    Unity 5.2.3. It is very rare for it to happen the way I mentioned. It's hard to reproduce.
    Also, the faster the player moves the more likely this glitch could happen.

    One way to repeat something similar to this is to somehow , using a script, continuously put an object with a collider inside the character control capsule.
    What should happen is the character controller begins getting pushed around the scene it random directions.
    It happened to me and I spent days trying to figure out why every time the player carried an item, the player would randomly start moving all over the scene. Then I realize it was the physics engine trying to push the player away from the item the player was holding, but my script kept putting the item inside the capsule, so it was a never-ending cycle.
     
  5. ziipzoop

    ziipzoop

    Joined:
    Jun 5, 2016
    Posts:
    3
    Unity 5.3.4

    With me it happens all the time, no trigger, no nothing
     
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Sounds like the same weird race condition that manifested (I think) the Mr. Game & Watch kamikaze glitch in SSB Melee... XD (Collision solver freaking out)
     
  7. ziipzoop

    ziipzoop

    Joined:
    Jun 5, 2016
    Posts:
    3
    Turns out it's not because of the keyboard - unplugging it changes nothing.
     
  8. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I think @TTTTTa's explanation was pretty accurate, unless your character's set up differently; the physics engine freaks out when the character moves, making the collision solver continuously push the object in one direction. Thus, unplugging the keyboard would have no effect.

    EDIT: Oh wait... which OS do you use? if you're using the Linux editor, there was some weird control related bugs that were fixed in the latest builds. If you're using an older build, I suggest upgrading.

    EDIT2: nvm, 5.3.4 in linux has that bug fixed.. XD
     
  9. Parallaxe

    Parallaxe

    Joined:
    Apr 9, 2013
    Posts:
    118
    Thank god I'm not the only one ...

    I also have this issue with one of my rigs. All other rigs don't show this issue (e.g. Win10 Laptop, OS X Laptop etc.).

    Here's the rig where I'm facing the issue. Maybe you want to check if we have a component in common (which might help to track down the root cause):

    - Win7 Pro 64bit
    - 64 GB
    - GTX 980 Ti
    - Roccat Ryos MK Pro
    - RAT Pro X
    - SpaceMouse Pro
    - Wacom Cintiq 27 QHD Touch
    - Latest drivers (of course ...)
    - Unity 5.3.x Pro (tried it with several x-es)

    When I first encountered the issue I thought something in my scripts was crap. But it turned out that it happens with any project. E.g. I have just tried it with a fresh project (5.3.5 in this case), loading only the most recent version of the Corgi engine (so that I can be sure that it's not related to any of my stuff). Nothing else, nothing changed, fresh download/import. Loading any of the Corgi engine's demo levels shows the same effect.
    Don't get me wrong: Corgi is DEFINITELY not the problem. It runs just fine on all my other rigs. And all other projects (own or Asset Store ones) are going mental on this rig as well. So it's definitely not Corgi (sorry Corgi-guys for taking you as an example ;) ).

    Is there a way to (script-wise) find out from which component the mysterious left button clicks are coming from?