Search Unity

[HELP] controlling wheel collider via touchscreen

Discussion in 'Physics' started by Beauchamp, Dec 29, 2016.

  1. Beauchamp

    Beauchamp

    Joined:
    Aug 11, 2014
    Posts:
    5
    Hye guys,
    I'm still kinda new. I managed to build a working terrain car using wheel colliders.

    I just noticed that the controls are kinda hard coded though? You just write some lines like...

    wheelCollider.motorTorque = torque;
    wheelCollider.steerAngle = steer;

    and the car magically starts to work when you press arrows for steering and throttle.

    [QUESTION]
    My question is how to adjust the momentary throttle and steeringangle of the wheels via script so I can control the car via touchscreen (in an android game for example)

    Ty for directing me the right way.

    A.
     
  2. Beauchamp

    Beauchamp

    Joined:
    Aug 11, 2014
    Posts:
    5
    still no idea how to override the arrow controls?