PlayerInput components Unity Events that pass PlayerInput as an argument do not recognize Dynamic Parameters

The PlayerInput component in the UnityEngine.InputSystem does not correctly show dynamic parameters when using Unity Events for the following events: Device Lost Event (PlayerInput), Device Regained Event (PlayerInput), and Controls Changed Event (PlayerInput).

What do you expect to show? Not sure what you mean by “dynamic parameters”. If I recall corrcectly, Unity Events require the implementation methods to match the event’s parameters.

I don’t use Unity Events for pretty much nothing anymore, and particularly for Input System it’s really nasty to forget about updating one of those events in the list.

I prefer to use C# events and the SendMessage method with generated Input system code since you no longer need to make any tweaks in the Inspector, and the generated interfaces provide a contract and guarantee that every action method is implemented.

Designers shouldn’t need to fiddle with the routing of event methods. They and you will get it wrong more often than not and it’s harder to debug because you just get no execution so you need to check both the Inspector (possibly multiple objects) and the Action Map.

Found the problem. Turns out I had another script in my project named PlayerInput (it was the script generated by the Input Action Map actually). So in my example code the compiler assumed the PlayerInput parameter was of the type I had made, when the event is of the type found in the UnityEngine.InputSystem namespace.

Unity Events do require the implementation methods to match the events parameters. The bug was that I appeared to be matching the parameters correctly, but it still wasn’t working. Turns out I was hiding that parameter type by accidently naming another class the same thing in a different namespace.