2

i'm trying to use the new unity's input system with multiple controllers.

I've tried creating input actions for each character but that didn't work. all the characters are moving at the same time. it looks like the characters does not care about the controller but care about the input regardless the controller. maybe i need to wait for the final release of the input system. But, i really don't want to use the old system because i think it's going to be removed when the new input system is fully released.

1 Answer 1

1

There is a component called PlayerInputManager which is used to "detect" when a new controller is connected / disconnected.

You have to provide it a prefab of the object (e.g. a character) you want to spawn whenever a player joins. This spawned prefab should have a PlayerInput component, which will be automatically registered on the input system as the controller you just plugged. Now, each controller will control a different character.

By default, your inputs will be forwarded to your character via the PlayerInput component using SendMessage() but you can also use other options.

Check out the Input System Documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.