currently I am struggling with the new input system when following the OnScreen Controls example from the new input system - specially with the analog stick, since it’s bound to gamepad devices.
So when I try to use these controls on pc with the mouse or on android with touch - it has no effect since it doesnt recognize a connected gamepad.
Is there a howto/tutorial how to get that to work on pc and android?
Since it’s a singeplayer game - the desired behavior would be that all controls are active at the same time: player can use onscreen controls and keyboard/mouse at the same time.
Created a new project with a simple platform and a cube to control via an onscreen analog stick.
Added new inputsystem + onscreen controls
updates eventsystem to new input system
add playerinput to cube & create standard input asset
create playerscript with OnMove method
Place Stick.prefab from OnScreenControl sample in scene
Now I can move my cube with awsd/arrows - but no matter what I’ll try - it’s not possible to move the cube via the stick. Neither on Android nor in Unity Editor.
I’m having the same issue! I can’t click to move the onscreen stick in the game window either.
The gamepad works fine when I attach it, but I’m trying to simulate mobile.
I’ve opened the sample called “OnScreenControlsSample”
I’ve noticed that if I use the Standalone Input Module (old input system), then the on-screen joystick works.
If I switch it to the Input System UI Input Module, then the on-screen joystick does NOT work…
Please see the image below; just flicking between those 2 modules in the inspector is enough to break it.
Sam, first, your video is great. Second, any idea why on-screen controls don’t work if you use the PlayerInput component instead of the generated C# class?
Would you mind checking out this post and letting me know what you think?
Thanks! Just responded, here’s a copy:
I’m able to use a PlayerInput component and an On-Screen joystick when the PlayerInput action asset is different than the one the EventSystem uses, but the sample doesn’t seem to work for me when using the same asset.
Unity v2020.2.7f1 & Input System v1.1.0-preview.3
I clicked on the script and notice that was conditional flags to allow the code to compile.
PACKAGE_DOCS_GENERATION || UNITY_INPUT_SYSTEM_ENABLE_UI.
Someone can explain to me why the script appears gray in VS?