Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question PlayerInput joystick detection !?

Discussion in 'Input System' started by Vagabond_, Apr 20, 2021.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi,

    i am using PlayerInput to detect when the control scheme is changed... it works great except it doesn't work when start uging the Joystick ( it's actually a steering wheel but the input system detects it as a joystick ) !

    Does the Player Input supposed to tell me when a joystick is used... i am doing it this way

    Code (CSharp):
    1. void Awake()
    2. {
    3.     PlayerInput playerInput = GetComponent<PlayerInput>();
    4.     playerInput.onControlsChanged += PlayerInput_onControlsChanged;
    5. }
    Code (CSharp):
    1. private void PlayerInput_onControlsChanged(PlayerInput obj)
    2. {
    3.     // Doesn't print anything when start using the steering wheel
    4.     Debug.LogError(obj.currentControlScheme);
    5. }
    Control schemes created by me !
    upload_2021-4-20_16-20-7.png