Navigate 2 Players in the Same Menu

Hey! I want to create a simple mario kart like select your player menu for 2 Players which looks like this at the moment

2348708--159010--question_ui_selection.png

the black squares with the numbers 1-12 are button components and the yellow and blue selector graphics are normal ui sprites.

my question would be:
how can i control/move the yellow selector with the WASD keys and the blue one with the ARROW keys to activate the buttons? (using WASD to highlight the buttons with a different color already works out of the box, but not moving the selector sprite)

and how can i save or output which button Player1 and/or Player 2 is currently selecting?
so that i can put something like “Player1: Slot 2” and “Player2: Slot 8”

Thanks!

I recenty answered a similar question and provided my own implementation here: Handling Multiple Inputs/Controllers - Unity Engine - Unity Discussions

I think that may be very close to what you’re looking for (2 players and sprite selectors over buttons)! Good luck! =)

Hey! Thanks!
I still can not get it running. i replaced the Event System with your CharacterSelectionEventSystem but nothing happens and when i place the StageSelectionInputModule in my Asset folder it gives me the error

“Assets/StageSelectionInputModule.cs(5,42): error CS0246: The type or namespace name `MultiPlayerInputModule’ could not be found. Are you missing a using directive or an assembly reference?”

Oh, that’s an easy bug to fix! The problem is I actually uploaded the wrong script… =P Please check the post again and take a look at CharacterSelectionInputModule.cs. :wink:

Sorry about that!

no problem :smile:
but now i get a new error :smile:

Well I mean, it is only an example script. =P I don’t mind posting mine, but I then use iTween which you’d need to have added to your project for instance. It’s probably easier to just create your own SelectionCursor class and implement that. :wink: That way you can also get it to behave the way you want it to from the get-go. That said, here’s mine if you need some inspiration.

2350358–159139–SelectionCursor.cs (1.05 KB)