Unity Vehicles experimental package now available

Car6
Car2
Car4
Car3

Hi everyone!

We are happy to release an experimental preview of the Unity Vehicles package today.

Unity Vehicles aims to be a universal vehicle controller for ECS that covers a wide range of vehicle types and configurations. The package targets a medium level of vehicle physics realism, striking a balance between performance and fidelity. It also supports any quantity of wheels on a vehicle, as well as runtime wheel adding/removing. It was architected in a way that makes it suitable for netcode and prediction.

We wish to thank NWH Coding, author of the excellent NWH Vehicle Physics 2, for their collaboration with us in creating this package.

Installation
To install the package:

  • open the Package Manager
  • click the “+” button in the top left
  • select “Install Package by Name”
  • enter com.unity.vehicles as the name. The version field can be left empty

Note that you will also need the com.unity.entities.graphics and com.unity.inputsystem packages installed in your project for the samples to work.

Getting Started
You may consult the package documentation here:
Documentation

The easiest way to get started with this package is to download the samples that come with the package, via the “Samples” tab of the package’s page in the package manager:

  • Minimal Vehicle Sample: demonstrates a bare-bones vehicle setup. Best used for learning the basics of the package, and for using as a starting template for new vehicle prefabs.
  • Advanced Vehicle Sample: demonstrates various types of vehicles, with camera control, UI, obstacles, moving platforms, etc…

Feedback
We appreciate any feedback or bug reports regarding this package. Don’t hesitate to post in this thread or report a bug using the bug report tool

53 Likes

the documentation page returns 403 Forbidden

2 Likes

Looking into it! Thanks

Could someone put that to the test? Like … a caterpillar Caterpillar. With wheels on all sides! I really want to see that! :grin:

I believe it should be fixed now, let me know if there are still issues

yeah, it works now, thank you
but every link from the side menu returns “Sorry… that page seems to be missing!”

you can go crazy with it

Car8

23 Likes

Thanks for making it support netcode prediction from the getgo.

Tried AdvanceVehicleController when played the car does not collide with ground/floor and start falling.

Any errors appearing in the console? And also, which Unity version is this on?

You could try restarting the editor, just in case this is happening due to a burst version upgrade that requires a restart

The Floor game objects layer was on Clickable set it to Default and it fixed the problem.

1 Like

Thanks for figuring this out so quickly, we’ll be releasing a quick fix for this soon. I do see the floor in the sample is on layer 6 by default, so depending on the project settings this could make things not work

2 Likes

That’s quite the thing! Roll-A-Ball PRO Extreme Premium Platinum Edition. :smiley:

1 Like

Would this work for a tracked vehicle like a tank?

Assuming the tracks would be a visual-only thing, then yes. You’d have a row of wheels on each side, and write some code to make the tracks visually move along these wheels

You may also want to create your own system that controls wheel torques, rather than using the built-in VehicleControlAuthoring. See the note about VehicleControlAuthoring being an optional component here. This way you can implement tank controls rather than typical steering

Could that row of wheels be intersecting? I mean the next wheel centered on the circumference of another (or even closer) such that the track-like properties could be simulated with “just wheels”. I’m guessing this is just a matter of defining the collision matrix to avoid wheel-wheel collisions.

That’s right, the wheels can intersect. Wheel collider casts ignore hits with their own vehicle rigidbody, and the wheel colliders become part of the vehicle rigidbody when added to a vehicle, so the wheel casts will ignore hits with other wheels on the same vehicle

2 Likes

Just an FYI, I had to install the Entities Graphics package to see anything in Game view when running the samples. It took me a while to figure that out having never used ECS before.

1 Like

This is very nice, thanks a lot for the library