Okay to have multiple of the same InputAction?

Is it okay to instantiate multiple InputAction/PlayerControls?

I’d like to use a single Input Action Map, but I want the handling to live in multiple files.

For example, mouse clicks and drags live in a system tied to camera. But, then some buttons presses live with the Canvas.

Will it be horribly inefficient to have one instance on each of the monobehaviors that handle the activity?

Curious about this too.

@Rene-Damm could you weigh in on this?

I have three instances of my InputActions. One on my camera to listen to the mouse zoom, one on my canvas to listen to the escape key (and other similar items) to trigger the menu opening, and the main one on my character to listen for clicks and keyboard input.

I see that when I add a debug output to InputSystem.onActionChange that it is triggering three times (well nine times, but three times on started, three times on performed, and three times on cancelled) since I have three enabled copies of my InputActionAsset. Is that going to cause problems?

Should I create one master input handler and hook my canvas, character and camera to that master input handler class instead?

Thanks.

1 Like

@Rene-Damm (or anyone else.) Checking in again.