1. How to get started! - Spawn and Link Road Pieces, Create a Loop and Spawn Traffic
2. How to create a loop
3. How to create a T Intersection
4. How to create a 4 Way Intersection
5. How to create Traffic Lights
6. How to Spawn Vehicles
7. How to Scale the Traffic System ( Road Pieces )
8. How to customize vehicles
9. How to create highways
10. How to create highway off-ramps
11. How to change the appearance of your road
12. How to switch the direction of road pieces and individual lanes
13. How to link opposite lanes together
14. How to create a custom road piece
15. How to use the Auto Cull Feature
FAQ 1 - The Traffic System has stopped working in the editor.
If you have edited a script of the Traffic System and now find the editor tools have stopped working, all you need to do is press "Play" on the unity editor and then "Stop" and everything will update with your changes.
FAQ 2 - I get a similar error when pressing play in the editor on my road network I've created.
This error means that you have not correctly linked up the road piece it is telling you about. Usually clicking on the road piece to put it in focus (while in editor mode, not play mode) "should" refresh any missing or null links. If not, you should either click on each not to see if there is a "missing" or "null" road link in the connected links, local connected links or change lane links and if there is, remove it. Failing that, you can always just delete it and relink the road piece to the surrounding road pieces.
FAQ 3 - How do I make my own player vehicles collide correctly with the Traffic System vehicles?
This is an easy one. All you have to do is drop the "TrafficSystemVehiclePlayer.cs" script onto any part of your player vehicle that has a collider on it, or to be more correct, any part of your vehicle that you "want" to collider with the Traffic System vehicles. The colliders for the player can be collision or triggers, the script will detect both. The Traffic System vehicles will then detect that a player controlled vehicle has come into their radius or actually hit them and they will brake and use the correct physics for collision.
FAQ 4 - How to enable City Generator and Road & Traffic System to work together
Once you've installed both "City Generator" and "Road & Traffic System" into your unity project you'll need to do the follow to get them working together.
In "Road & Traffic System" you need to open the "TrafficSystemPiece.cs" file located under "Assets\Traffic System\Scripts". Once open you need to uncomment this line near the top of the file:
// #define CITY_GENERATOR
In "City Generator" you need to open the "CityGenerator.cs" file located under "Assets\City Generator\Scripts" and also the "CityGeneratorEditor.cs" file located under "Assets\City Generator\Editor". Once open you need to uncomment this line near the top of each file:
// #define ROAD_AND_TRAFFIC_SYSTEM
That's all there is too it, the renderer on the TrafficSystemPiece.cs scripts become the ClearZones for all the City Generated objects to avoid. You can also tweak the Global and Local "RoadClearZoneOffset" for each road piece to make the avoid zone smaller or larger per piece. This can be done globally in the City Generator prefab or locally per road piece prefab. Clicking on a road piece will outline the ClearZone for that piece in blue once the #define in "TrafficSystemPiece.cs" is uncommented.
I have another issue.
Feel free to get in contact with us with any inquiries you might have with the system. firstname.lastname@example.org
© 2023 Wired Developments PTY LTD