Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Repomensch on January 24, 2016, 06:44:44 PM

Title: Unable to get input from separate controllers' analog sticks
Post by: Repomensch on January 24, 2016, 06:44:44 PM
TL;DR - I'm making a multiplayer game. Buttons and triggers only effect one character as expected, but analog sticks effect all characters.

I am making a top-down dual-stick action game with local multiplayer featuring identical characters. I can press the A button on a controller and spawn a character prefab. His controls are as follows:

This all works for one character and pressing the A button on a second controller spawns the second character. [EDIT]: However, the sticks on the first controller cease to have any apparent effect, and the sticks on the second controller move and aim both characters.

What's strange is that, despite being handled in the exact same way as the analog sticks, the Right Button and Left Trigger functions both operate as expected. That is, the buttons of one controller effect one character only. So, I seem to have it figured out for RB (Get Button Down) and LT (Get Axis), yet the same solution does not work for the analog sticks (using either Get Axis or Get Axis Vector, depending on the situation).

This is how it's set up:

I had thought the issue was using global variables to store input, but since RB and LT both work, it seems safe to assume that each character knows which globals belong to it. My Input Manager looks nearly identical to those I've found online that claim to have accomplished local multiplayer.

Can anyone shed some light on this issue?
Title: Re: Unable to get input from separate controllers' analog sticks
Post by: Repomensch on January 24, 2016, 07:39:51 PM
I found the solution:

In my FSM that handles movement, I set local variables to the value of the global variables, and then used the local versions of the variables to manipulate the character's movement and aiming.