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

AVC - Arcade Vehicle Controller

Discussion in 'Assets and Asset Store' started by Carwashh, Nov 22, 2019.

  1. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,449
    I tried to make a new car with the vehicle builder and choose box collider, but it does not make a box collider
    Can you check if this work for you @Carwashh
     
  2. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    I did it last night in my own game, and it was fine. What version are you using? Did you type in the correct name for the GameObject that the box collider will be a child of? By default this is set to 'body' .. but if you don't have a GameObject called 'body' it's not going to work.
     
    Lars-Steenhoff likes this.
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,449
    Ah yes I did not do that, now I will set the name correctly, Thanks
     
    Carwashh likes this.
  4. koraybirand

    koraybirand

    Joined:
    Dec 4, 2020
    Posts:
    11
    Hi I am using AVC for my motorbike. When I turn on Two Wheel tilt I get undesirable results as seen in the attached photo. Any ideas ? Thanks Screen Shot 2021-02-27 at 17.04.07.jpg
     
  5. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Hey - You need to adjust your model hierarchy a bit, the body is being tilted, but the wheels aren't children of the body to tilt with it. Hopefully this page explains it enough for you: https://avcdocs.enigma23.co.uk/vehicles/preparing-your-vehicle
    If not, throw me an email (support [at] enigma23.co.uk) with some screenshots of your hierarchy (or just send the model, if you can) and I'll help further.
     
  6. koraybirand

    koraybirand

    Joined:
    Dec 4, 2020
    Posts:
    11
    Hmmm I tried putting the wheels as a child when I play the game my whole model rotates x 90 degrees .. I created my vehicle using the prefab creator as explained.
     
  7. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Have fixed the setup, found something I need to improve in AVC and replied to your email!
     
  8. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Haven't posted the last few updates, which include a few additions and fixes.

    - I've added a touch screen example scene, for mobile. Demo available for Android - https://play.google.com/store/apps/details?id=com.enigma23.avc (iOS won't accept the demo)

    - A method to make Jumping easy has been added. https://twitter.com/en9g131/status/1394376918112382977

    - A Class to link to the VehicleBehaviour easily has been added. This is useful for collisions, because if you're using just the sphere collider, then the VehicleBehaviour isn't a child of the Rigidbody making it difficult to get a reference to. Pop this component on the Rigidbody, assign the VB and you can use vehicleLinker.VehicleBehaviour to get the reference.

    - Fixed the ground check so that big vehicles are detecting the ground correctly.


    ---------------------------------
    v1.16 - 16th May 2021
    - Added a new public jump method to VehicleBehaviour, use Jump(float) - where the float is the force to jump by
    - Added a new class 'VehicleBehaviourLinker' to make it easier to get the VehicleBehaviour - see the SphereRigidbody GameObject on the example vehicle prefabs for its use

    --------------------
    v1.15 - 1st May 2021
    - Fixed the ground check, the size of the vehicle should now no longer matter

    --------------------
    v1.14 - 16th April 2021
    - Added package for Unity v2020.3 (LTS)
    - Added touch screen controls example
    - Removed left over trigger colliders from prefabs
    - Fixed position of smoke on AI motorbike
    - No longer updating packages for 2020.1
     
    Agha, modernator24 and Lars-Steenhoff like this.
  9. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    233
    Mirror support in future at all?
     
  10. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    No networking solution is currently planned. The code has been made in such a way that it should be easy enough to work with any networking, inputs, etc.
     
  11. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    233
    -Support for new input system would be good
    -Option to have tickbox for automatic 'Update Vehicle Settings' for quicker iterations
    -Mirror support example script/scene
     
  12. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    AVC is input agnostic, it just takes values passed into it from your own control scheme. So it already supports the new input system out of the box, as well as the old, InControl, Re-Wired,etc,etc.

    I do not like the new input system at all, so won't be doing any further work with it, however there is an example gist available to show how AVC and the system works together: https://avcdocs.enigma23.co.uk/github-gists

    Some of the vehicle settings don't require the button click to be updated, the button is there for a couple of the settings that do require it - as they're cached in Awake/Start. For example, maxSpeed is cached as defaultSpeed, because of the boosting. I'll have a look to see if I can improve this.

    Sorry, I've never done anything with any networking solution, Mirror (and any other networking) is out of scope for AVC. As AVC is input agnostic, all it requires is for the values to be passed into it.
     
  13. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.18 - 4th August 2021
    - Added new vehicle setting 'Slide Threshold'. This allows you to tweak when a vehicle will start sliding down a slope

    --------------------
    v1.17 - 17th July 2021
    - UPDATE NOTE: This update may cause the VehicleBehaviour to lose the Rigidbody assignment. If your vehicles don't move after updating, please re-assign the vehicles Rigidbody to the VehicleBehaviour component field 'VehicleRigidbody'
    - Front wheels turn when stationary
    - Renamed property 'PhysicsSphere' to 'VehicleRigidbody'
    - Moved all create items into AVC sub-menu
     
    Last edited: Aug 10, 2021
  14. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.19 - 10th August 2021
    - Added CurrentSpeed property to return the current speed as a float
    - Improved slope sliding
    - Fixed vehicles using the box collider setup not sliding down slopes
     
  15. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
    I was just coming here with the same question! I'll try this tonight, thanks!

    Side note, I got this when I tried to email you: There was a temporary problem delivering your message to emailaddress@youremail. Gmail will retry for 47 more hours. You'll be notified if the delivery fails permanently.
     
    Last edited: Sep 21, 2021
  16. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    You shouldn't need to manually setup a box collider, the prefab builder has a tick box which you can select and it will create a vehicle hierarchy correctly with a box - you may need to resize the collider to fit your vehicle better.

    Cheers - I'll check if everything's ok with it. I did receive a support email earlier today though, hopefully it's just an internet fart.
     
  17. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
    Well, using the box collider example got me further ... I think it's something to do with the way I mount my character in the car with a camera attached. But now when you hold 'w' the vehicle drives forward a bit then slows to a stop, then jumps in the air ... When turning it doesn't rotate around the centre of the model either ...
    I have an extra "trigger" box collider to detect when the character is close, then parent him to "HarrysSeat"
     
  18. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    It's possibly the ground raycast hitting the trigger collider. Put the trigger collider on its own GameObject, and set the layer for that GameObject to something that isn't being used to detect the ground (this is set in the vehicle settings).
     
  19. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
    Appeared to be that I had Rigidbody on child game object. Moving it to the root parent fixed everything. Looked like the "empty" parent was being left behind in world space ... so turning became crazy and the rigidbody would only travel so far away from the parent. Anyway, soooo good now. Can't wait to play with it more.

    I think others have already noted, if you turn of "Turn when stationary" once your vehicle comes to a stop, it will only turn the wheels, but will no longer go forward or back. Are we supposed to programatically turn that off and on?
     
  20. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    The 'Turn When Stationary' bool isn't something done in mind that you would change it at run time. When this bool is true, pressing left/ right will turn the wheels AND rotate the vehicle. When this bool is false, turning left/ right will only turn the wheels, the vehicle will not be rotated.

    This shouldn't affect movement forward/ backwards.
     
  21. Aryenv

    Aryenv

    Joined:
    Jun 7, 2020
    Posts:
    2
    Hello, can you help us with this please?
    We need a top-down control Movement for a controller. The car goes into a direction while we use the control, for example if we move the controller to the left, the car goes left. If the player change from left to right, the car will make a curve to turna round the new position. The car acelerate and move in the direction that the player use in the controller.
    We use your asset.

    Like this input in the first seconds of the video.


    Our final result that we want is this
     
  22. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    I hadn't thought about this kind of movement, but I think it'll make a good addition. I'll have a look into it, see if I can get it in AVC without changing anything as it is
     
  23. Aryenv

    Aryenv

    Joined:
    Jun 7, 2020
    Posts:
    2
    That would be great. I will be attentive to your updates. Thanks a lot!!
     
  24. greg725

    greg725

    Joined:
    Apr 11, 2015
    Posts:
    4
    Hi, can you elaborate a bit on the properties of the Example AI Movement script, specifically the Side Sensor Offset value? I'm tuning a custom vehicle prefab that works fine with the Example Input (WASD controls), but it struggles to navigate the waypoints on the AI test track. The vehicle weaves side to side a lot and takes the first corner too early, where it works its way through the wall and falls off the track. I'm using the same settings as the Car_AI prefab, which navigates the track correctly.

    Is there anything to do differently for AI vehicle setup in regards to rigidbodies or colliders?
     
  25. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Hi, sorry for the delay in replying - been busy/ missed the notification. Email is best for support queries.

    Please note, the AI class is JUST an example, it's purpose is just to show how to interact with the vehicle behaviour for AI... it's probably not good enough to be in a game.

    With that said..
    sideSensorEndOffset will change the length of the sensors off the side of the car. This value will probably need tweaking differently for your tracks.
     
  26. Felicityinc

    Felicityinc

    Joined:
    Nov 24, 2016
    Posts:
    24
    Hello @Carwashh,
    First of all great asset, I have been intrigued to buy it for some time now. I have a suggestion for this asset. I don't know if it covers your vision for the asset. But here it goes -
    There was this asset Randomation Vehicle Physics which had a stunt mode available to it. So, you could basically do flips, spins and rolls and get some score going all coded in the demo scene. Can you do this for this asset? Specifically for the motorbike, I haven't seen anything like it on asset store yet.

    RVP - https://github.com/JustInvoke/Randomation-Vehicle-Physics
    Incase, You haven't checked it out.

    Let me know, Looking forward. Great work!
     
    Carwashh likes this.
  27. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Thanks for the suggestion, while something that I wouldn't have thought of / had out of scope, it's a good idea and could help AVC stand out from other assets. Will take a look and see if it's something I can add!
     
    shyamarama and Felicityinc like this.
  28. Felicityinc

    Felicityinc

    Joined:
    Nov 24, 2016
    Posts:
    24
    Yeah, I think this will really be something very different.
     
  29. BunnyViking

    BunnyViking

    Joined:
    Nov 28, 2019
    Posts:
    16
    Is it possible to add extra wheels to a vehicle ? (extra sets of rear wheels for example)
     
  30. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    At the moment you can have zero, two, three or four wheels. You could probably easily add a new class to take care of additional wheels, but I'll get something added in the next couple of weeks for this.
     
  31. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
    I know I have something set up wrong but can't quite place it, thought you may know right off the bat. The parent object is rotating back to 0,0,0 whenever no key is pressed. I can set it to say 0, 130, 0 in inspector and it will (apparently lerp) back to 0,0,0. Using example Input it turns when keys are pressed, but only to about 45 degrees. When you let go of the key, back to 0 ... any ideas? (Happening on one model I just converted, I'm sure I must've put something in the wrong field.) I can upload a pic tonight ...
     
  32. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
  33. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    You've got the wrong GameObjects assigned for 'Vehicle Model' and 'Vehicle Rigidbody'. The parent GameObject should be empty. Your model isn't setup in the best way either -> check the example car that is included with AVC. And follow the docs here on how to prepare your model: https://avcdocs.enigma23.co.uk/vehicles/preparing-your-vehicle

    ArcticWolf01 = remove everything.
    Model = Kart.
    Rigidbody = SphereCollider.

    The prefab builder will set all this up correctly for you. Here's the page on the docs which explains everything: https://avcdocs.enigma23.co.uk/vehicles/building-your-vehicle
     
  34. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Update has been submitted with this feature added.

     
  35. Rebaken-Enterprises

    Rebaken-Enterprises

    Joined:
    Nov 17, 2014
    Posts:
    16
    Amazing! I'm going to update!
     
    StevenPicard likes this.
  36. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    It hasn’t been approved yet. Probably Monday.
     
  37. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.20 is live now.. didn't get any emails to notify me about it.

    Check the docs here for wheel spin and here for wheel turn. Please take extra care to assign the correct transforms to each component, otherwise you'll end up with rotation conflicts and things will look weird/ won't work.

    ----------
    v1.20 - 12th February 2022
    New Features
    - Added class to rotate additional wheels, allowing for more than 4 wheels
    - Added class to turn additional wheels, allowing for more than just the front two wheels to turn
    Fixes
    - Fixed bug when adding trails after builder hasn't found a wheel
    Updates
    - Additional prefab builder setting saved that previously wasn't
     
  38. Lorrak

    Lorrak

    Joined:
    Sep 17, 2019
    Posts:
    38
    Hello, is it possible to get more of leaning with bike? and i tried examples in asset, i can't get that type of leaning like in your youtube's video, it leans but not so much, and sometimes it looks bike is leaning like it's car, completely to different side
     
  39. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Enable 'Two Wheel Tilt' on your vehicle settings
    https://avcdocs.enigma23.co.uk/vehicles/vehicle-settings
     
  40. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.22 - 26th April 2022
    - Fixed MaxSpeed not being reachable. MaxSpeed can now be as low as '1' and move correctly. NOTE: With this update all your current speends may need lowering by 6.
    - General code tidy
    - Added new package for Unity v2021.3
     
  41. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746


    I'm working on adding an audio solution for AVC. Here's a WIP video of what it's going to be like. Please ignore the poor SFX, I'm no audio technician..
     
    shyamarama likes this.
  42. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.5 has been submitted and is the biggest update ever for AVC.

    Some highlights.

    Audio
    The biggest new feature with v1.5 is that AVC now has an audio solution, for engines, drifting and collisions. Use the AudioData asset to setup the various sound you want to use, assign to the vehicle and done.
    AudioData.png

    Ground Follow
    One of the bug fixes caused the vehicle to hug the ground a lot tighter when driving off a decline at speed, so I added this as a setting in the VehicleBehaviourSettings, now you can toggle between the default (how it's always been) and a tighter ground follow.. hopefully my awesome art illustrates this well enough.

    LooserGroundFollow.png

    Collision Effects
    AVC now has collision effects. You can have a default effect, that happens for all collisions, and also use the 'CollisionTag' component to add a custom effect for specific GameObjects.
    upload_2022-5-23_21-4-43.png

    Prefab Builder
    The Prefab Builder has been updated to include all the new components, so you can add them when creating a new vehicle. For any vehicles already created, the Car_Box and Motorbike_Box prefabs are setup with the new Audio and Collsion components.

    ----------
    v1.5 - 22nd May 2022
    Added
    - Vehicle audio component added. This component is used for engine start, engine running, engine stop, drifting, collisions

    - Collision effects. Easily added particle effects for collisions.

    - Collision Manager component added. This component deals with the collision events and calls its own events to pass them to the new audio and effects components (OnVehicleCollisionEnter, OnVehicleCollisionExit, OnVehicleCollisionStay)

    - Drift settings are now a ScriptableObject. These are required for Vehicle Effects (drift tire marks/ smoke) and Vehicle Audio

    - Engine can now be toggled on/off, with an option to auto start (new events added for these - OnStartEngine, OnEngineStarted)

    - Tight/ loose ground follow option

    Updates
    - Ground alignment has been greatly improved, following the contours of the ground much better than before

    - Vehicle will now rotate towards the ground as it falls through the air (optional, this can be toggled in the VehicleSettings)

    - VehicleSettings have been updated to add all the new features

    - Prefab builder tided up and new features added. UseBoxCollider is now forced to true, older setup is being phased out

    Fixed
    - Now using OnGround raycast to accelerate, instead of NearGround as this allowed the vehicle to change direction and move in the air causing weird movement. This also lead to the tight/ loose ground follow option being added

    - Setting the position when a vehicle is using the box collider setup no longer ends up in the model spinning around
     
    shyamarama and StevenPicard like this.
  43. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.5 is now live!
     
  44. Gardan

    Gardan

    Joined:
    Jul 5, 2012
    Posts:
    3
    Hi, I'm considering purchasing your asset, but I'm still wondering if it would suit my project.

    I need smooth and simple car physics for moving around the town with a car (it is no racing game at all), similar to what Kirby and the Forgotten Land's Car Mouth transform does. Manoeuvrability is great and it doesn't become crazy when going airborne.

    Please find attached 2 short videos I recorded:



    Do you think that would be achievable with some tweaking of the car's settings? AVC has a great feel to it compared to other solutions in the market, so I'd love to be able to use it.
     
  45. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
  46. Gardan

    Gardan

    Joined:
    Jul 5, 2012
    Posts:
    3
    Thank you so much for the prompt reply and the video!

    I'm purchasing AVC now, as it's exactly what my project needs.
    Can't wait to start tweaking!
     
  47. ElonWu001

    ElonWu001

    Joined:
    May 10, 2022
    Posts:
    1
    plugin looks great! our project need a mutilplayer car plugin, did this plugin support mutilplayer?
     
  48. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.5.1 - 17th June 2022 (in review)
    Added
    - Strafing now has it's own tilt value in the vehicle settings

    Updates
    - Fixed minor typo in prefab builder help

    - Removed Cinemachine namespace include that snuck into VehicleBehaviour
     
  49. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    Sorry I missed your question.

    There is no inbuilt multiplayer specific code, however, AVC doesn't require it. All AVC requires is input to tell it what to do, that can be from 1 player, multiple players, or AI.
     
  50. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    746
    v1.5.2
    Fixed
    - Wheels now rotate again when steering the vehicle