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

Edy's Vehicle - Mobile Controller

Discussion in 'Scripting' started by 0x00000F, Jul 18, 2014.

  1. 0x00000F

    0x00000F

    Joined:
    Jun 16, 2014
    Posts:
    16
    I have Edy's vehicle asset and I'm trying to make it work on mobile with gas/break/steering wheel. When I press gas pedal on my device it's not moving. How to move it?

    I'm doing like this:

    Code (CSharp):
    1.  
    2. public CarControl cc;
    3.  
    4. if(pedal_clicked){
    5. cc.motorInput = 1f;
    6. }
    7.  
    8.  
    This is wrong?
     
  2. Saeedk78

    Saeedk78

    Joined:
    Jul 18, 2014
    Posts:
    2
    You can use acceleration for car controlling.

    for example:
    Code (JavaScript):
    1. ... = Input.acceleration.x * 5;
     
  3. 0x00000F

    0x00000F

    Joined:
    Jun 16, 2014
    Posts:
    16
    But in Edy's script, there are 3 basic things to control car:

    motorInput
    brakeInput
    steerInput

    How can I use this..? I don't think I'm doing wrong.
     
  4. Saeedk78

    Saeedk78

    Joined:
    Jul 18, 2014
    Posts:
    2
    You also can use GUI buttons on the screen.
     
  5. 0x00000F

    0x00000F

    Joined:
    Jun 16, 2014
    Posts:
    16
    Ok mate..

    Any solution? Am I wrong ?
     
  6. 0x00000F

    0x00000F

    Joined:
    Jun 16, 2014
    Posts:
    16
    I still have this problem.
     
  7. KumareshR

    KumareshR

    Joined:
    May 31, 2017
    Posts:
    1
    you find the solution for this?