Answers for "player input manager join manually"

C#
0

player input manager join manually

//Use this if you want to join players manually with unity's new input system
//This connects all active devices to a gameobject setup for inputsystem input
//Check your player prefab's player input component's Auto-Switch box

using UnityEngine.InputSystem;
void JoinConnectedDevices()
{
	int playerNo = 0;
	for(InputDevice device in InputSystem.devices)
    {
    	playerInputManager.JoinPlayer(playerNo++, playerNo++, null, device);
    }
}
Posted by: Guest on August-07-2021

C# Answers by Framework

Browse Popular Code Answers by Language