0 votes

I know that I can use joypad_connection_changed but it only works after you plug the controller while game is already running. People often plug the controller before they launch the game so is there a way to check if controller is connected when launching the game? Maybe I should emit joypad_connection_changed manually but I don’t know how. Please help!

Godot version 3.3.3
in Engine by (15 points)
edited by

1 Answer

+1 vote
Best answer
Input.get_connected_joypads()

Will return a list of connected joypad ID's

Input.get_connected_joypads().size()

Will be zero is no device is found

by (4,604 points)
selected by

Thank you! That worked.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.