Search Unity

[RELEASED] 2D Vehicle Control (2D Physics)

Discussion in 'Assets and Asset Store' started by ZANTcr, Jul 12, 2014.

  1. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    SlideShow2DVehicleControl.png

    Create your 2D vehicle in seconds with a simple script and make your game more faster.
    This asset work and support all the 2D components for Unity like WheelJoint2D, 2D Colliders, Rigidbody2D and more.

    Some features of this asset are:
    - Easy configuration
    - Support multiple wheels
    - Clean code.
    - Multiplatform.
    - Drag and drop prefabs.
    - Sprites for your project.
    - Speedometer for manual transmission


    If you want to test some features play the demo!!
    Update 1.2.0

    - Manual Transmission
    - Speedometer for manual transmission
    - Minor bug fixes
    - Unity 5 supported

    Update 1.1.0

    - Mobile Control script.
    - Mobile example scene for Android,iOS, WP8 and BlackBerry.
    - Accelerometer control support for mobile devices.
     
    Last edited: Mar 31, 2015
  2. rayfigs

    rayfigs

    Joined:
    Feb 8, 2009
    Posts:
    41
    Hello I was interested in your script. Would it b possible to maintain a wheelie on a motorcycle with your script? I'm looking for functionality like thin this example : https://play.google.com/store/apps/details?id=com.dakinagames.wheelielegend
    Thanks,
    Ray

     
  3. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Hello rayflig,
    The script has an option to allow wheelies and you can maintain it, by default it is enable.
    You can play the demo to test some functionalities like the suspension and the wheelies. With this asset in Unity you can replace the car sprite in the demo with your motorcycle sprite or follow the tutorial of the asset and customize speed, spring and more options.
    Thanks for your comment and Regards.
     
    Last edited: Sep 30, 2014
  4. chubby owl

    chubby owl

    Joined:
    Jun 5, 2013
    Posts:
    8
    Hello.
    Does it support manual transmission?
     
  5. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Hello,
    for the moment the script does not support manual transmission but we will consider it on the next update. If you have another question feel free to ask.
    Regards!
     
  6. chubby owl

    chubby owl

    Joined:
    Jun 5, 2013
    Posts:
    8
    Thank you for the answer. What is the release date for that update?
    I develop simple casual 2d car racing game and your asset seems to be a good choice for that kind of game but I definitely need manual transmission.
     
  7. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    The next update was estimated to october 18, but it could change depending on the Unity review of the asset and if it is approved.
    I want to know if you need a manual transmission where the user has to change the transmission by some input or the transmission is changing automatic by the script.
     
  8. chubby owl

    chubby owl

    Joined:
    Jun 5, 2013
    Posts:
    8
    By input (button or gesture for instance).
     
  9. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Ok, you can stay in contact for more information. I will inform you if the next update will include the manual transmission as soon as possible.
     
  10. chubby owl

    chubby owl

    Joined:
    Jun 5, 2013
    Posts:
    8
    Thanks!
     
  11. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Manual transmission is now supported.
     
    Dev234 likes this.
  12. Dev234

    Dev234

    Joined:
    Oct 29, 2014
    Posts:
    10
    Hi! Your asset is GREAT!
    I have some questions for you :

    1. How can I make the wheels to rotate even when the car is turned upside down to the grounds?
    2. Is it possible to control one wheel for going forward(gas) and one wheel for going backward(brake)?
    3. How about the smoke effect or dirt effects when we drive the car?

    Thanks you for your great asset!
     
  13. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Hello and thank you for your support!

    I will try to answer your questions as best as possible.

    1. In the script when you dont touch the ground it disable the gas control to prevent accelerate the vehicle because it works with rigidbody2d aceleration.
    You could modifiy the script and use the motor speed option of your Wheel Joint 2D instead acceleration and comment isGrounded() on the update method.
    However it could be a little difficult.

    2. I dont know if I understand this well but here is my answer :)
    You could duplicate the SimpleControlVehicle script (you can rename it to SimpleControlBackward) and change on the AccelerateVehicle() the input control (horizontal) to your new controls, and invert all the if conditions. e.g.

    if(rigidbody2D.velocity.x >= maxSpeed) will be if(rigidbody2D.velocity.x <= maxSpeed)

    In your vehicle GameObject add the original script and the new script. Set to 1 the size wheel option and drag and drop your wheel for the corresponding script. In the SimpleControlBackward set your acceleration, maxSpeed, brakeForce and reverseMaxSpeed to a negtive value.

    3. The script doesn't support a smoke or dirt effect for the moment (sounds tentative for the next update) but you could add a particle system to the car.

    Regards,
    Steven.
     
    Dev234 likes this.
  14. Dev234

    Dev234

    Joined:
    Oct 29, 2014
    Posts:
    10
    Thank for your reply!
    I am playing with your asset, and it's working wonderfully!
    I will try your suggestions soon.

    Anyway, if you could implement the dirt effect in the future update, your asset will be more awesome! (it's already awesome :) )

    I will post more questions for you if I meet problems!

    Best regards,
     
  15. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    I'm very glad that the asset is working for you!

    Probably we will consider the dirt effect in the next update.

    Let me know if you have any other question.

    Thanks.
     
  16. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Can the accelerometer be used to control the vehicle's forward/back tilt?
     
  17. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Yes, the asset comes with an scene example for mobile, you just have to check the accelerometer option on the mobile script.
     
  18. bobbylee

    bobbylee

    Joined:
    Aug 15, 2013
    Posts:
    49
    Will this be updated to work with Unity 5? Right now nothing in the examples even work correctly.

    Thanks.
     
  19. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Yes, the asset will be updated as soon as possible. The changes of Unity 5 force us to modify the asset in some things, but this will be corrected :).

    Thanks and Regards.
    Steven.
     
  20. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Unity 5 is now supported! :cool:
     
  21. bobbylee

    bobbylee

    Joined:
    Aug 15, 2013
    Posts:
    49
    Great, thank you, I was hoping it would not die in the U5 release :) .
     
  22. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    We are still alive ;)
     
  23. jorgegb1997

    jorgegb1997

    Joined:
    Apr 15, 2014
    Posts:
    56
    Hello!

    I buy your script and I implement in my android car, but I have a problem, the sensibility of "ratation buttons" (U_Arrow and D_Arrow) it´s to much, when I press the button in my android platform the car turns too quickly, how can I change this?

    PS: Good work ;)
     
  24. jorgegb1997

    jorgegb1997

    Joined:
    Apr 15, 2014
    Posts:
    56
    Done, thank you, very easy code ;))
     
  25. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    You're so fast!

    I would like to document a possible fix to this. We can increase or decrease the frontForce and backForce in the SimpleControlVehicle script, these properties are in charge of apply rotation force in the vehicle.

    Thank you for the support!
     
    jorgegb1997 likes this.
  26. bakiet

    bakiet

    Joined:
    Jun 7, 2015
    Posts:
    11
    hi, yesterday i buy the script but when i try to implement or use the demo scene the car dont move, i see manual and video and all its good, what can be?
     
  27. ZANTcr

    ZANTcr

    Joined:
    May 27, 2014
    Posts:
    15
    Hi Bakiet,

    What platform are you using for the demo? (Pc, Android, etc)

    Thanks and regards!