Search Unity

Touchscreen Steering Wheel Rotation Example (Mouse Supported)

Discussion in 'Community Learning & Teaching' started by yasirkula, Aug 21, 2013.

  1. Farhan-Aqeel

    Farhan-Aqeel

    Joined:
    Aug 18, 2014
    Posts:
    1
    Updated in 2015.. Still a Life saver in 2018!!! Thankyou Maestro!!
     
  2. saadali211

    saadali211

    Joined:
    Feb 17, 2017
    Posts:
    10
    ✅ [ SOLUTION ] Here is a detailed video tutorial with free Asset follow this video to implement the Steering wheel script to a car.

     

    Attached Files:

    yasirkula likes this.
  3. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    786
    That's amazing! Thanks for creating this tutorial!
     
    saadali211 likes this.
  4. saadali211

    saadali211

    Joined:
    Feb 17, 2017
    Posts:
    10
    welcome
     
  5. RealityStudio

    RealityStudio

    Joined:
    Jul 25, 2012
    Posts:
    9

    Attached Files:

    yasirkula likes this.
  6. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    786
    Glad to see it in production!
     
  7. stf940

    stf940

    Joined:
    Jan 29, 2019
    Posts:
    4
    somebody explain me please! i bought a pickup truck from assets store. i have keyboard controls and mouse for freelock camera. how i can put steering wheel controls for mobile? im stuck at this please help i searched and tried all i saw
     
  8. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    786
    Attach the SteeringWheel script to the steering wheel UI object and use its GetClampedValue function to retrieve its input value. Alternatively, you can take a look at SimpleInput (it has a built-in steering wheel): https://github.com/yasirkula/UnitySimpleInput/
     
  9. parigojariya02

    parigojariya02

    Joined:
    Mar 2, 2019
    Posts:
    4
    Hello sir...
    I'm totally new in unity.
    I have done steering wheel as you suggest.
    Now what should i do so that my car follow the input of steeringwheel.
    I'm makign racing game for mobile.
    Please help me.
     
  10. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    786
    You should store SteeringWheel in a public variable and replace Input.GetAxis("Horizontal") with steeringWheelObject.GetClampedValue() in your script.
     
    parigojariya02 likes this.
  11. parigojariya02

    parigojariya02

    Joined:
    Mar 2, 2019
    Posts:
    4
    Thanks a lot sir for your quick reply.
     
  12. parigojariya02

    parigojariya02

    Joined:
    Mar 2, 2019
    Posts:
    4
    Thanks sir..,
    But,I actually didn't get where to I should store SteeringWheel as a public variable.I have tried "steeringWheelObject.GetClampedValue()" in my script,But I get error for "GetClampedValue()".
    Please Help me.
    Thanks.
     
  13. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    786
    public SteeringWheel steeringWheelObject;
    in your car controller/input script. Then, assign its value from the Inspector.
     
  14. parigojariya02

    parigojariya02

    Joined:
    Mar 2, 2019
    Posts:
    4
    Thanks sir..!