Hi,
I’m making a sports game with local multiplayer. It supports different types of inputs like keybaord, PS4, XBox, etc. The ‘Player Input Manager’ is set to ‘Invoke Unity Events’ and ‘Join Players When Button is Pressed’.
There is a menu where players can choose their team. Each controller should be represented with an icon.
The challenge: When a new controller joins, I want to check what type of device it is and assign it the correct icon.
public void JoinNewPlayer(PlayerInput playerInput){
Debug.Log($"input type: {playerInput.devices[0]}");
// figure out what kind of controller it is
// assign the corresponding icon
// if(playerInput.devices[0].deviceType == "DualShock4") {playerInput.menuIcon = ps4ControllerIcon}
}
The debug log does tell me what kind of device it is however it doesn’t return a string or anything I know how to check in the script.
How do I check the type of device this PlayerInput is using and do something with that?