|
I have this code in C# to control my Rigidbody sphere character:
Problem is that character won't jump if I press space while holding 2 axis nor move left if I'm holding UP and SPACE and then press LEFT for example. I think there's a kind of buffer for keys but 2 keys seems to be a little too small so I'm wondering what am I doing wrong.
(comments are locked)
|
|
Whole code for movements for my Rigidbody-Sphere-Character that moves on a 45 degrees axis (don't mind the portuguese comments):
(comments are locked)
|
|
There are limits to how many keys the keyboard itself will actually keep track of, so it might just be the keyboard, and not Unity or your code. (Game controllers don't seem to have this issue, only keyboards do. I don't know if the problem is the hardware, drivers, or OS, but its a common problem playing any game with a keyboard.) I'm not sure if you are actually using enough keys to be hitting that limit. A good way to test it though is by trying other games using keyboard controls, and see if the control stops responding well when holding high numbers of keys at the same time. My keyboard limit is 4 keystrokes anywhere else. :<
Jan 04 '10 at 07:05 PM
Lex
If that DOES occur you should hear your computer go "BEEP! BEEP! BEEP!" 99/100 times it's the handling, not the hardware, that can handle all the keys you need for single player games applications or other software ( which makes sense, since nobody would buy a keyboard that works only with 80% of the programs out there )
Oct 29 '10 at 09:14 AM
Proclyon
(comments are locked)
|
|
Problem solved, you wouldn't believe if I said that the SPACE key was the problem. I still don't know why it won't work with SPACE but it works fine with any other key I tested. Maybe SPACE is a kind of special key or just a bug... I don't know... I checked input options and tried either GetButton() and GetKey() for SPACE and it's definetly the key but it works fine with the character controller though... If anyone out there knows the reason please answer here because I still want to jump with the SPACE key as it's a kind of universal key for jumping.
(comments are locked)
|
|
This is likely some kind of bug. I have the same issue with left ctrl also. If I drive my vehicle around and press forward and steer right (w and d) and press space or ctrl at the same, the key is not read. This works fine when playing e.g. BattleField on the same computer. I think that the Unity guys should look into this. Something is not working properly. /Ricky
(comments are locked)
|
|
Hello, any updates on this issue? How did you work around it? I really want to use the space button with the arrow keys :( Thanks in advance! /Kweiko I have the same issue with Unity 4 and 3 on different projects, different machines and different keyboards! I noticed, that it does not work with the left arrow key. When I hold down for example the left and up arrow keys and then press another arbitrary button, the third one will not be tracked. When I press two buttons and then the left arrow key, the left arrow is not tracked. However, everything works fine when I use WASD + other keys.. IMO it's a Unity bug.
Dec 05 '12 at 07:46 PM
hicks
(comments are locked)
|

the problem is in other parts of your code
Could you enlighten me then? Any guesses?