Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Controller Disconnection #48

Open
TheYellowArchitect opened this issue Aug 26, 2022 · 0 comments
Open

Detect Controller Disconnection #48

TheYellowArchitect opened this issue Aug 26, 2022 · 0 comments
Labels
input Anything related to controller or keyboard input low priority Not important or to be focused

Comments

@TheYellowArchitect
Copy link
Owner

What if you play and suddenly you pull back and the wire of your controller gets unplugged? The game doesn't pause. It should.

This is often a problem with problematic controllers (I remember a ps4 one) which have a very "sensitive" wire plug.

Coding Implementation

string[] gamepadNames = Input.GetJoystickNames();
	if (gamepadNames.Length == 0)
		//Give warning

In case controller isnt detected normally (e.g. television controllers also count), make a class where in each Update() checks for each button, and once pressed, destroys itself.

@TheYellowArchitect TheYellowArchitect added input Anything related to controller or keyboard input low priority Not important or to be focused labels Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input Anything related to controller or keyboard input low priority Not important or to be focused
Projects
None yet
Development

No branches or pull requests

1 participant