Exception when caling "FindNewGamepads()" - ArgumentOutOfRangeException
Phischermen opened this issue · 0 comments
Phischermen commented
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
This line is the culprit. Modifying the code to replace RemoveAt(player.GamePadIndex)
with Remove(player.GamePadIndex)
fixed the issue; it appears that piece of code is for culling gamepad indexes that are already connected, but RemoveAt
can lead to culling the wrong index / causing an out of range exception.