My game can be played with either KB+M, or a controller. I'm trying to create tutorial messages that are specific to these control schemes.
So if the player is using keyboard+mouse to play the game, the message should say "Press Space to Skip", but if a controller is plugged in, then the message would say "Press Start to Skip"
I feel there's already a way to do this but I'm missing it. The only other way I can think of doing this would be through variables that would get set when selecting a control scheme through the main menu. But since you don't need to select a control scheme through the main menu (just plugging in a controller allows you to plug in and play immediately) the variables wouldn't come into effect.
Of course, a final workaround would be to just write "Press Space/ Start to Skip" and be done with it, but I figured I'd ask for opinions about this before resorting to that ![]()
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Detecting the presence of a controller is a general Unity question - a couple of threads on the Answers site can be found here:
https://answers.unity.com/questions/218477/how-can-i-detect-if-a-gamepad-is-present.html
https://answers.unity.com/questions/1100642/joystick-runtime-plugunplug-detection.html
Such code could be adapted to set the value of an AC Global Variable, i.e. a Boolean named "Is using controller?". To set the value of an AC Global Variable through script, see the front page of the Scripting Guide.
Getting a controller and keyboard AND mouse all working together interchangeably seems to be a complicated matter from what I understand (esp when it comes to menus) I think keeping the game only KB+M might save a lot of headache. I might return to this later though, thanks for the help!