When I add a PlayerInput component, I can decide between messages and events. While the events worked as expected, given feedback for each occurrence, the SendMessage behavior throws me into an unexpected way.
I have a “Shoot” button (click, space, etc.) and I want it to fire while the key is held. When I instantiate the input class and call functions through the started and canceled callbacks, I am fine. When I use the events, I get an “InputAction.CallbackContext” instance and I can handle the phase there.
But when I use the SendMessage, it does not allow me to receive an “InputAction.CallbackContext”, it only gives me a value which tells nothing about the phase.
Can I know, using the SendMessage option, if the action is started, performed or canceled?
If someone wants to know how did I do solve the problem, I made a MonoBehaviour that handles the events manually and workaround the issue. I don’t know why the developers didn’t do the SendMessage part consistent with the behavior of the other parts, but I do imagine it has performance implications or another issue I do not realize now.
Anyway, for the small project I am playing, the workaround is pretty sufficient!