Closed willerxxmiller closed 6 months ago
changing the assert to:
if(device_actions.has(device)):
seems to fix it
hmmm I think that assert should still be there because it is a safeguard to protect me against myself. I do see my comment below that assert line and I'm wondering if any of those situations is what is happening to you?
Things to check:
If neither of those work, can you try testing your hypothesis by putting print statements at the very top of the _create_actions_for_device method to see if that gets called before the assert fails?
Closing to clean it up. Feel free to re-open or create a new issue if you still need some help :)
If I plug in a controller in my joinable scene, the game crashes.
`## Returns the name of a gamepad-specific action func get_action_name(device: int, action: StringName) -> StringName: if device >= 0: assert(device_actions.has(device), "Device %s has no actions. Maybe the joypad is disconnected." % device)
if it says this dictionary doesn't have the key,
The game crashes on the
assert(device_actions.has(device), "Device %s has no actions. Maybe the joypad is disconnected." % device)
with an error of "Assertion failed: Device 1 has no actions. Maybe the joypad is disconnected".
I think when I plug the controller in, it triggers the "join" action before the action can be created from the "_on_joy_connection_changed".