- Home /
New Input System, Multiple controllers plugged in Issue.
Iv been converting my game over to the new Input system and so far it works fine when i just use KB/Mouse or my Steam controller, but when my PS5 controller is plugged in, it causes the move function on the kb/mouse to not work all, and the Jump to not work properly on all devices. After adding some debugs it seems the Input system calls all Context.started/performed/canceled in one frame, regardless of whether the key is held or released.
public void Move(InputAction.CallbackContext context)
{
Debug.Log("Move pressed : " + context.ReadValue<Vector2>());
// Move our character
horizontalMove = context.ReadValue<Vector2>().x;
}
public void Jump(InputAction.CallbackContext context)
{
if (context.started) //Started
{
Debug.Log("Jump started");
jumpHeld = true; // Turns jump velocity on
}
if (context.canceled) //Released
{
Debug.Log("Jump released");
jumpHeld = false; // Turns jump velocity off
}
}
Move is setup using a value/vector 2 Jump is setting as a button with Press and Release.
Do i need to do some sort of declaration of which controller is the main controller? having multiple controllers plugged in was never an issue with the old input system (i could switch between them at any point)
Also i added an "On-screen stick" and " On-screen Button" which also work fine in the game tab when i use them with my mouse, but are unresponsive or working incorrectly when i build and try them on android (i assume its related).
Thanks.