Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by oooooooooott · Oct 14, 2014 at 10:13 PM · editorinput

Keyboard input not working

One day, when I got on to Unity, I tried to test my project out in the Editor. Everything worked fine- Except for the fact that suddenly, none of my inputs were working. To test if this was some other part of my code, I added a snippet which prints a message whenever I give a certain input in Update().

I found a problem exactly like mine, with no clear problems in the code. I think whatever was wrong with this guy's Unity is wrong with mine, and I have no idea how to do what he did. Honestly, I just need to know how to get to the Input Registry he mentioned.

http://answers.unity3d.com/questions/372239/basic-keyboard-input-not-working.html

I am almost certain the problem is not in my code, but if somebody thinks I'm wrong, tell me.

 if(Input.GetButtonDown("Interact") && distance < maxdistance){
 AddItem();
 }

EDIT: In the AddItem function, I have Debug.Log("Added Item!"). Just so people know.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MrSoad · Oct 14, 2014 at 10:33 PM 1
Share

Have you made sure your Input Setting(under Edit - Project Settings) name is called "Interact" for the button you want to trigger this action? You prob have but worth a double check for typo's. Are you pressing any other keyboard keys at the same time, there is a bizarre thing to do with how keyboards are physically wired which stops button recognition if more than three are pressed simultaneously(It does depend on which buttons but the direction arrows are affected on my keyboard).

avatar image oooooooooott · Oct 14, 2014 at 10:42 PM 0
Share

Thank you for commenting! I have checked for typos, and there are none I can see. I got my keyboard with my new desktop, and one of it's features is Anti-Ghosting. (Just in case you are wondering, the "Interact" input is bound to E).

avatar image MrSoad · Oct 14, 2014 at 10:48 PM 1
Share

I never knew it was called Ghosting, thanks! as for the fix I'm stumped, sorry.

Put this code in and see what, if anything, pops up in your debug window.

 if (Input.GetButtonDown("Interact")) {
     
     Debug.Log("Button press is working");
 
     if (distance < maxdistance) {
     
         Debug.Log("Distance check is working");
         
         AddItem();
     }
 }
avatar image oooooooooott · Oct 15, 2014 at 12:19 AM 0
Share

I tried to use that code in the script, but still, nothing happens. D:

avatar image MrSoad · Oct 15, 2014 at 12:22 AM 1
Share

Then I am truly at a loss for how to fix this. Sorry I can't be more help. Anyone out there got any ideas? Have you put a Debug.Log before this code to check that you are getting to this point, my last hope of being any help to you.

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Bunny83 · Oct 15, 2014 at 02:15 AM

Well, if you are sure that:

  • You defined a virtual axis called "Interact" ...

  • Your "distance" is indeed smaller than "maxdistance" ...

  • You're executing this if-statement inside Update of an enabled script on an active GameObject in the scene while you're in play-mode ...

...then... i have no idea.

I've checked my registry if that key exists (Win 8.1) but the there is no "Input" key under that path. If you want to check your registry, just press Win+R and type "regedit". Navigate to the path mentioned in the post you've linked (`HKEY_CURRENT_USER\Software\Unity\UnityEditor`) and check if there is a string value called "Input".

On my PC there's only one string value and it's called "Editor StatsDone" which is set to the string "yes".

(ps: Just in case you didn't know, don't mess up anything in the registry or you might nuke your system, at least if you don't know what you're doing ;) I strongly suggest to create a system restore point ;))

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image oooooooooott · Oct 15, 2014 at 02:56 AM 0
Share

Thank you so much for the feedback! I checked out my registry, and I did have a listing there. I deleted it, and everything works fine now! :D

avatar image Bunny83 · Oct 15, 2014 at 03:17 AM 1
Share

Just googled around and it seems that in the past (< Unity 3.5) Unity had problems using some game controllers. Inserting that reg-key forces Unity to use DirectInput (the input wrapper from DirectX). However since Unity 3.5 this key seems to completely break the input. Usually some developers just "suggest" that their customers should add this reg-key, but it looks like there are some developers that just set this key on their own. $$anonymous$$aybe you have played one of these Unity games and that key got set. Usually it doesn't exist.

avatar image Benjanak · Oct 20, 2016 at 08:26 PM 0
Share

Hello :!!!

I have the same problem..... i try to learn Unity but during the tutorial "ball collecting object"... and after second chapter, I just realize that my keyboard dont control anything.... the script i wrote for moving the ball is good but there is just no reactions when i launch the scene..... I try to take a look at my registry following your advice and i have two line in the unityEditor folder : "Editor Statsdone" and "(par défault)" Doesnt seems to be the "listing" oooooooooooottt and bunny83 were talking about.....

Also another info : i have install an older version of Unity 4.3.4 for another tutorial learning.... and the keys are working !!!! HELP §§ I A$$anonymous$$ So lost..... it's working with the 4.3.4 but not with the 5.4.1

avatar image
0

Answer by alexander11 · Oct 14, 2014 at 11:34 PM

you can go to Edit/Project Settings/Input in unity thats were all your inputs are. have a look at em maybe it have reset and stuff if that doesn't work make a new project see if that helps.:D :D

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Benjanak · Oct 20, 2016 at 09:12 PM

Hello :!!!

I have the same problem..... i try to learn Unity but during the tutorial "ball collecting object"... and after second chapter, I just realize that my keyboard dont control anything.... the script i wrote for moving the ball is good but there is just no reactions when i launch the scene..... I try to take a look at my registry following your advice and i have two line in the unityEditor folder : "Editor Statsdone" and "(par défault)" Doesnt seems to be the "listing" oooooooooooottt and bunny83 were talking about.....

Also another info : i have install an older version of Unity 4.3.4 for another tutorial learning.... and the keys are working !!!! HELP §§ I AM So lost..... it's working with the 4.3.4 but not with the 5.4.1

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

32 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Prevent unity hotkeys in editor 0 Answers

Does the Unity editor support touch input? 1 Answer

mouseposition and clicks in editor sceneview 0 Answers

[Unity Editor] Emulate Touch Input - Still Asking 12/10 1 Answer

rotate with alt doesnt work 15 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges