Prototype--Week3--2 players


We tested out a implemention of controller support for our game. Using the new input system to do this, we set up two player and had them spawn in, but ran into a issue with webGL not recognizing the controllers. This resulting in us reverting to the old input system and coding hotseat controls using the keyboard for 2 players. Our goal is to look into getting controller support to work after our testing sessions.


To get our two player hotseat system working, we created two new axes in the unity input manager, we assigned one to each player, we also setup key variables in the movement script so that we could set the controls for each player in the inspector. This allowed us to have 2 players on one keyboard and when we implement controller support hopefully we can assign controllers to players in the same way.

Once we got two players spawning in and each having working controls we moved onto setup of UI elements for both players, each player has there own UICamera, and Canvas, to display their HUD. Having to duplicate these elements might come back to haunt us if we manage to get 4 player works as we will need to duplicate a extra 2 UICameras, and 2 more Canvas.

Files

Web.zip Play in browser
Sep 28, 2021

Leave a comment

Log in with itch.io to leave a comment.