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
  4. Dismiss Notice

Cross Platform Input Controller Not Working On Mobile Device

Discussion in 'Editor & General Support' started by siddharth3322, Apr 10, 2019.

  1. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,042
    I have used Unity's Standard Assets - Cross Platform Input Control to create Dpad as per my game requirements.

    I have following this video tutorial for implementation:


    I have just imported Cross Platform Input data within the project, as like this only because of other things not useful to me.
    standard_assets_crossplatform_input.PNG

    Now to move the 2d player character, I have used this code:
    Code (CSharp):
    1.  horizontalMove = CrossPlatformInputManager.GetAxisRaw("Horizontal");
    2.    verticalMove = CrossPlatformInputManager.GetAxisRaw("Vertical");
    4 Dpad buttons, I have a setup like this way:
    dpad_setup.PNG

    After using the above code to get input for player movement, within Unity Editor, I can able to move my player but within the mobile device, I can't able to get any values. For horizontal and vertical both values, I was getting 0 as output.

    Now give me some guidance to solve mobile input related solution based on Dpad buttons touch.
     
    Last edited: Apr 10, 2019
    abdullahnaveedahmed likes this.
  2. abdullahnaveedahmed

    abdullahnaveedahmed

    Joined:
    Jul 11, 2020
    Posts:
    3
    I'm facing same issue, any solution?
     
  3. Hansel41

    Hansel41

    Joined:
    Mar 15, 2020
    Posts:
    10
    has anybody solved this issue yet???
    In my case, Everything works like a charm in unity's editor but when i build the game for android, UI buttons doesn't work at all as it looks like the mobile input option is turned off by itself.
    It seems like the problem is in Cross Platform Input Manager's Mobile mode option as it looks it's on but after build it seems that it's been turned off by itself.