- Home /
Change input settings type from script
For testing purposes I need a toggle between "Key or Mouse button" and "Joystick Axis", is there any way to change this during game? (I want a Keybord/Joystick toggle ingame)
Answer by ScroodgeM · Aug 08, 2012 at 08:35 PM
declare a boolean 'UseKeyboard' somewhere in your input controls script
switch it on any user interaction, should it be GUI switcher or a button?
depends on state of UseKeyboard, read and use keyb or joystick
Im not sure I understand? I know how to do a boolean, what I can't find anywhere is how to change the type of input. If you go to the "Input $$anonymous$$anager" (Edit -> Project Settings -> Input) you have the option to set the "Type" of each element. For Horizontal, this type is set to "$$anonymous$$ey or $$anonymous$$ouse button" as default, I have to change this to "Joystick" for my controllers to work. What I want to avoid is to set up two elements for each function (exsample, Horizontal and HorizontalJoystick) and have different types on each and then swich between these in script. What i do want is to just change the type of each element through script.
http://feedback.unity3d.com/unity/all-categories/2/top/active/scripting-expose-input-manager-
this feature is still not developed 8) vote to force it 8)
8)))))))))
thanks 8) but not here you should vote up 8) follow the link and vote up there for features you want to be first 8) by the link above there's feature to access to Input using scripts