Hi there!
I’m using Preview3 of the IS on PC+XBOX
Filtering input from a single controller (and ignoring the other 3) seems to be something trivial, but I’m probably doing something wrong. Or, it’s right in front of my eyes and I have 2 big hams on them.
I currently am on a PC+XBOX project, and -I confess-, I turned up my nose when thinking about using 3rd party solutions such as Rewired.
Fact is: it’s pretty late, and almost all project (a single player only project) has been getting all input via ActionMaps, but NOT using PlayerInput - which initially felt a bit overkill, and with plenty of unused features I didn’t need.
Now Unity seems to suggest hooking up an InputUser to PlayerInput.
All I currently have is an InputActionAsset with different ActionMaps (depending on the game internal logic - an actionmap for the UI, one for moving the player, etc.) that I manually enable/disable when appropriate.
I’m using the auto-generated GameControls partial class (
auto-generated by com.unity.inputsystem:InputActionCodeGenerator)
, which can be referenced everywhere via a persistent singleton GameControlsManager
I was hoping to find a field that let me filter all gamepad input from a single source, but instead I have 4 gamepads which could control the same player.
And that’s not so good on XBOX - pretty sure Microsoft isn’t going to like that
I also have some partial wrapper of the input, so I -could- refactor most things if I could retrieve from each InputAction the InputUser/PlayerInput it’s coming from.
Fact is, I’m a bit clueless about how to do that, and it’s very specific.
I couldn’t find any code snippet to do that, and the docs seem to be a bit generic.
Could you please point me in the right direction or share any suggestion?