Search Unity

Question How to get the X and Y coordinates using the new input system?

Discussion in 'Input System' started by LeoFeitosa, Jul 29, 2020.

  1. LeoFeitosa

    LeoFeitosa

    Joined:
    Jul 5, 2017
    Posts:
    32
    Hello everyone.
    I'm trying to get the X and Y coordinates separately in a similar way to the old system, but I'm not getting it, could you help me?
    I'm trying to get it like this:
    Code (CSharp):
    1. inputX = input.PlayerActions.Movement.ReadValue<Vector2>().x;
    2. inputY = input.PlayerActions.Movement.ReadValue<Vector2>().y;
    But apparently I only get X data