Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Generic joystick axis problem

Discussion in 'Scripting' started by wermon, Sep 19, 2018.

  1. wermon

    wermon

    Joined:
    Dec 11, 2017
    Posts:
    7
    Hi guys and having problems with axis pm unity. I'm using generic joystick I might try to get z axis, dial, slider and rotation ix and y. But without success, they're only take x and y axis. Help! :(
     
  2. shawnrevels

    shawnrevels

    Joined:
    Aug 13, 2014
    Posts:
    86
    It would help if you post your code.
     
  3. wermon

    wermon

    Joined:
    Dec 11, 2017
    Posts:
    7
    Code (CSharp):
    1. if (player_numero == 0) //PLAYER 1
    2.         {
    3.             axis_y_1 = ((Input.GetAxisRaw("2") * Globales.sensibilidad_1 + axis_y_1_offset) * (sensibilidad_y));
    4.             axis_x_1 = ((Input.GetAxisRaw("1") * Globales.sensibilidad_2 + axis_x_1_offset) * (sensibilidad_x));
    5.         }
    6.         if (player_numero == 1) //PLAYER 2
    7.         {
    8.             axis_y_1 = ((Input.GetAxisRaw("3") + axis_y_1_offset) * (sensibilidad_y));
    9.             Debug.Log("Eje 3 =" + Input.GetAxisRaw("3"));
    10.             axis_x_1 = ((Input.GetAxisRaw("4") + axis_x_1_offset) * (sensibilidad_x));
    11.             Debug.Log("Eje 4 =" + Input.GetAxisRaw("4"));
    12.         }