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

Unity 5 Cross platform input not working and tutorial needed

Discussion in 'Editor & General Support' started by Mikdad_Merchant, Apr 10, 2015.

  1. Mikdad_Merchant

    Mikdad_Merchant

    Joined:
    Apr 10, 2015
    Posts:
    3
    Hi,

    The cross platform input is not working. I took the survival shooter sample compiled in for android on unity 5 imported the cross platform input package and put the joystick controller on the player, but still things do not work on the unity remote app. I also request you if you could arrange a tutorial for cross platform input in general because with unity 5 it is different as compared to unity 4.6 where we had the standard assets - mobile in unity 5 we need to use the cross platform input, correct? so it is difficulat to understand. Also there isn't any help in the unity manual as well
     
  2. hugettini

    hugettini

    Joined:
    Apr 1, 2013
    Posts:
    19
    I agree.
     
  3. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Also can't get the Joystick to work, using it in exactly the same way I used to before.

    I also put together a test program.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5. using UnityStandardAssets.CrossPlatformInput;
    6.  
    7. public class TestJumpNewGuiText : MonoBehaviour
    8. {
    9.    Text readout;
    10.   bool jump;
    11.  
    12.    void Start () {
    13.      readout = GetComponent<Text>();
    14.  
    15.      if (!readout)
    16.      {
    17.        Debug.Log("Readout needs a NEW GUI Text component!");
    18.        enabled = false;
    19.        return;
    20.      }
    21.    }
    22.  
    23.    void Update()
    24.    {
    25. // GetButton Returns true while the virtual button identified by buttonName is held down.
    26.   jump = CrossPlatformInputManager.GetButton("Jump");
    27.      if ( jump )
    28.      {
    29.        readout.text = "Jump";
    30.      }
    31.   else
    32.   {
    33.   readout.text = "NO Jump";
    34.   }
    35.    }
    36. }
    I never see a JUMP only NO JUMP....

    Anyone see anything wrong with that test?
     
  4. transatlantic

    transatlantic

    Joined:
    Mar 30, 2013
    Posts:
    2
    @twobob - In your project, make sure you do GameObject->UI->EventSystem. As soon as I added that to mine, everything started working.