Hey, I love this new system. Really a lot. But at this moment, I made 2 control schemes one for ds4 and one for keyboard/mouse. Then I assign left stick (up, down, left, right) and WASD keys for keyboard.
Controller works great, I can set lightbar colors and everything… but the controller keeps on running. When I try to move a character with controller, everything works. When I do the same with keyboard, it debugs right but then due to gamepad running… it never moves my character properly. It gets stuck and stuff.
Here is the code…
private void OnEnable()
{
_controls.Enable();
_controls.Player.Movement.performed += OnMovementInput;
}
private void OnDisable()
{
_controls.Disable();
_controls.Player.Movement.performed -= OnMovementInput;
}
private void OnMovementInput(InputAction.CallbackContext ctx)
{
MovementInput = ctx.ReadValue<Vector2>();
Debug.Log(MovementInput);
if (ctx.control.device is Gamepad)
{
var controller = (DualShockGamepad)Gamepad.current;
if (MovementInput.x < 0)
controller.SetLightBarColor(Color.red);
else if (MovementInput.x > 0)
controller.SetLightBarColor(Color.green);
else
controller.SetLightBarColor(Color.blue);
}
}
Am I missing something? I remove my controller and keyboard works great. Also when I stop playmode my ds4 is still lit up.