Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics Character Controller Demo not working without INPUT define #194

Open
JoelFrutiger opened this issue Dec 9, 2020 · 6 comments
Open

Comments

@JoelFrutiger
Copy link

In order for the Character Chontroller demo to work i had to add the UNITY_INPUT_SYSTEM_EXISTS to the defines. Maybe this should be added per default in the ProjectSettings.asset:

scriptingDefineSymbols:
1: UNITY_POST_PROCESSING_STACK_V2;UNITY_INPUT_SYSTEM_EXISTS

@lawrnce
Copy link

lawrnce commented Jan 13, 2021

@JoelFrutiger Thanks!

@AwokeKnowing
Copy link

AwokeKnowing commented Mar 14, 2021

I add it and it made mouse start working but not keyboard. Its absurdly disheartening that we're dealing with a super mature game dev project with multiple input 'systems' and hundreds of lines of code about moving the player and yet it cannot detect 'WSAD' or any keyboard input, and there's no warnings, no checks nothing. it just doesn't work. I've programming for 25 years and here I am 2 hours later unable to just get it to detect WSAD input to move the character controller of the demo.

I can't believe using the mouse required that crazy define above, and i can't believe this not addressed after months.

@MyelinsheathXD
Copy link

MyelinsheathXD commented Mar 15, 2021

Hey!
try

#if UNITY_INPUT_SYSTEM_EXISTS

@AwokeKnowing
Copy link

AwokeKnowing commented Mar 15, 2021

@myeg yeah i see in the code there are these #if UNITY_INPUT_SYSTEM_EXISTS and I did add that thing on the scripting define symbols, and that makes the mouse work, but not the keyboard.

When using keyboard debugger, i see for example when I press w is says 'character w' and when i press s it says 'format=KEYS' s
and in general it's kind of wacko with the mappings. it seems Unity has made some wrong assumption and is relying on some system service it shouldn't, or relying on some mapping that is different for windows vs linux.

But ubuntu 20.04 is current LTS and so it's quite sad that the unity input system doesn't work.
if i use getKey directly it works fine. So it's something about the implementation of the input system which tries to be more abstract and universal yet comically fails at it's most core purpose to support WSAD/space/arrows

EDIT: FURTHER INFO:
I started a fresh project with just the input system and tanks demo that comes with it. results:
When i run the 'remap UI' scene, wsad keys don't trigger anything but
zxcv keys trigger [keyboard] 4 [keyboard] 5 [keyboard] 6 [keyboard] 7

That's really weird. it's as though it's shifted 'down' 3 rows. some kind of 'high bit' or something is off. but the keyboard works fine in all other apps

@JannikStaub
Copy link

If you are not using the new Input System and dont want to enable this scripting define you can paste this code to the start of the DemoInputGatheringSystem OnUpdate()

#if !UNITY_INPUT_SYSTEM_EXISTS
m_CharacterMovement = new Vector2(UnityEngine.Input.GetAxisRaw("Horizontal"), UnityEngine.Input.GetAxisRaw("Vertical"));
m_CharacterLooking = new Vector2(UnityEngine.Input.GetAxisRaw("Mouse X"), UnityEngine.Input.GetAxisRaw("Mouse Y"));
m_CharacterFiring = UnityEngine.Input.GetMouseButton(0) ? 1 : 0;
m_CharacterJumped = UnityEngine.Input.GetKey(KeyCode.Space);
#endif

@Electricavisuals
Copy link

Please unity developers, can you fix it?
Thks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants