A neat feature for Input System

The new Input System sure is a lot more modular but it turns into spaghetti rather quickly on big projects with lots of ActionMaps.

I think making Actions a seperate .asset file that can be shared across ActionMaps can make things a lot easier. Currently Actions only exist inside ActionMap. To share Action between different maps we need to duplicate same Actions and maintain them as the project grows.

Example: Let's say you can chat while both Vehicle and Character (or etc) ActionMaps are active, with current approach you would have a "Chat" Action for each map which is not ideal. But with suggested approach you only need one Action with "Enter" key set as Input, even when saving/loading user modified inputs it's easy to do because there's only single key for chatting.

  • Another good thing about this approach is that we can just reference that Action asset ("ChatAction.asset") from any script (ChatSystem.cs for example) and it doesn't need know about the whole input system, just reference the action from script and subscribe some method(s) to it.


No. The proper way is to have a general action map with all the actions doesn't change when you swap vehicles and have vehicle-specific action maps to enable/disable specific actions.
Which means you should define the chat button only once and keep it separate from your Vehicle and Character actionmaps in a "General Gameplay" (or you can call whatever you like) actionmap. Same for things common between (pause)menus and gameplays.
You can have as many actionmaps as you need to describe your specific situation.

1 Like

[quote]
No. The proper way is to have a general action map with all the actions doesn't change when you swap vehicles and have vehicle-specific action maps to enable/disable specific actions.
Which means you should define the chat button only once and keep it separate from your Vehicle and Character actionmaps in a "General Gameplay" (or you can call whatever you like) actionmap. Same for things common between (pause)menus and gameplays.
[/quote]
That will work until it doesn't. There will be eventually be a point where it's too specific to put into categories like "General Gameplay". It's more intuitive this way imo.

[quote]
You can have as many actionmaps as you need to describe your specific situation.
[/quote]
This is a really weak argument, point is to reduce that count not increase it.

1 Like


But why would you reduce it and generate a lot of individual actions? Besides, you can already do that outside of the InputActionAsset. I don't see the usefulness here, but you do you, of course.