Leafwing-Studios / leafwing-input-manager

A straightforward stateful input manager for the Bevy game engine.
Apache License 2.0
686 stars 106 forks source link

Print errors when user forgets to `.add_plugins(InputManagerPlugin::<XyzAction>::default())` #560

Open atlv24 opened 2 months ago

atlv24 commented 2 months ago

Which feature is frustrating to use or confusing?

I often forget to .add_plugins(InputManagerPlugin::<XyzAction>::default()) and have everything else set up properly, there's an entity with InputManagerBundle and InputMap set up and I'm reading actions from a registered system, but the actions never happen because the plugin wasn't added.

Expectation

We can detect if actions are being read on an ActionState that has not been ticked and print errors. It should be rather simple to do this too, just have a flag "has plugin" default to false, and have the plugin set it to true. We might want this to compile out in release if perf is a concern.