How to know if Unity/computer detects controller plugin

Hi everyone,

I got stuck where I try to figure out how to make the engine recognize the controllers. Here is what I want to do:

When I plug in 2 controllers, Unity will detect them. When I plug out the controllers, I can use the keyboard again.

I need to know a script/line that let me know when the engine detect the controllers whenever I plug in or out.

If you need to know more details about my problem, please let me know

Answers are really appreciated.

(yeah i know controllers aren’t joysticks :P, but they are picked up there)

Thanks :slight_smile: