Callback Issue with Controller Support


I have been trying to figure out the issue with a callback error related to an onDeviceChange Unity Event I was using to detect controller connection and disconnection for quite a long time. I had talked with another person on the team about the issue and he suggested that I needed to unsubscribe from the Unity Event, which seemed tricky to me because the setup for this Unity Event was different than usual. He showed me that I can subscribe the event through the use of a listener and then simply unsubscribe OnDisable. I just simply needed to pass in InputDevice and InputDeviceChange parameters and then pass those into the where they are needed in the function. This prevent the issue of never unsubscribing from the event when disabled and thus creating errors.

Leave a comment

Log in with itch.io to leave a comment.