Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Mobile Traffic System - City traffic for games

Discussion in 'Assets and Asset Store' started by GleyGames, Jun 5, 2021.

  1. d555565600

    d555565600

    Joined:
    Mar 8, 2018
    Posts:
    1
  2. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
  3. fog12345

    fog12345

    Joined:
    Sep 10, 2020
    Posts:
    1
    Issue with Give Way waypoint. it only waits for 1 car to go and neglect other cars behind that car so they collide every time.
     
  4. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Thank you for reporting an issue, but in order for me to be able to verify it, can you please provide some steps to reproduce, or a project or at least a screenshot of your waypoint configuration with some explanations.

    Thank you!
     
  5. unity_V1WlANEebEQloQ

    unity_V1WlANEebEQloQ

    Joined:
    Jul 1, 2019
    Posts:
    10
    I am working with other roads.They are not Easy 3d Roads, so I am not able to create traffic roads.Do I need to use only Easy 3D Roads To use this Package
     
  6. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    You can draw your roads on any type of collider, The package is only compatible with other world building packages but does not require them.

    You can check the full tutorial series here and check if it is good and easy enough for you before you decide to buy it.

    https://youtube.com/playlist?list=PLKeb94eicHQtyL7nYgZ4De1htLs8lmz9C
     
  7. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, is it possible to use Mobile Traffic System to manage a train line on a railway? I mean also making the train to stop to the stations.

    Thanks!!
     
  8. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello, MTS was not designed for trains. You can create a special route and make the train go on that route but that is just a workaround and it might not look good because the trains needs to be more rigid than a car.
     
    tomobiki likes this.
  9. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    75
    Hello, I am building a city builder game similar in style to SimCity, where the player will place roads on a map. The simulated population will drive cars on the newly placed roads between specific points, such as their house to their place of work.

    The player will make roads by placing road tiles on terrain, and I would like these new roads to be connected to the traffic network when they are placed so that cars can travel on them.

    I would like the cars to appear as background props when the player's camera is over the road network (a bit like how cars work in Grand Theft Auto, where they spawn around the player). So the cars would not need to have a set destination.

    Would it be possible to use your asset to achieve this?

    Thank you for your help.
     
  10. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    No, my asset is not good for city building game, the roads cannot be created at runtime, thy need to be created before build. The other things are already working but my asset is not good for what you need.
     
  11. sunxiatao

    sunxiatao

    Joined:
    Jun 7, 2019
    Posts:
    3
    Hello, I was wondering if it is possible to switch between player controller (from another package or developed by myself) and AI controller (from the Mobile Traffic System package) on the player vehicle at runtime?
     
  12. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    If you want to control an AI car yourself, it is possible, but you need to add the required components on the car you want to drive at runtime and remove that car from the AI control using this:
    GleyTrafficSystem.Manager.StopVehicleDriving(vehicleGameObject);

    This will give you full control over the traffic vehicle.
     
  13. sunxiatao

    sunxiatao

    Joined:
    Jun 7, 2019
    Posts:
    3
    Thanks! By adding and removing the components at runtime, will I be able to switch between manual control and AI control back and forth? I tried to add the AI control back after removing the AI control. It seems like the car after removing from AI control is not in the car pool anymore. I was wondering if there is any API for me to add the AI control back to the car?
     
  14. RehanBhutta007

    RehanBhutta007

    Joined:
    Sep 3, 2020
    Posts:
    9
    Everytime, When i import and use Gley plugin it show me a error,,
    upload_2022-3-28_8-51-35.png
     
  15. GNGames2020

    GNGames2020

    Joined:
    Jul 4, 2020
    Posts:
    1
    Hello. I Purchased Mobile Traffic System but I have error:


    Please Help me. Thanks!
     
  16. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    No the car needs to be respawned to be added again in the pool. it is no other way
     
  17. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Please reimport the package, it seems something got deleted.
     
  18. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    I am not able to see your image, so I do not know what error do you have
     
  19. laibaabbasi1

    laibaabbasi1

    Joined:
    Mar 8, 2022
    Posts:
    2
    Hello, I am unable to create road on my scene..?
    why is t so happen to me?
     
  20. unity_08441457046216CC790C

    unity_08441457046216CC790C

    Joined:
    Mar 10, 2022
    Posts:
    2
    Hello I always get this error when apply setting in traffic system windows

    upload_2022-5-27_19-45-10.png
     

    Attached Files:

  21. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Please check the 3rd video I recorded on this topic.


    If you need technical support, please send your request to gley.assets@gmail.com providing details and/or captures, adding your invoice number and I will surely guide you.
     
  22. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Please use the verified version of burst for your Unity version and it should work without issues.

    If you do not manage, please send your request to gley.assets@gmail.com providing details and/or captures, adding your invoice number.
     
  23. unity_08441457046216CC790C

    unity_08441457046216CC790C

    Joined:
    Mar 10, 2022
    Posts:
    2
    Hello the burst compiler work, thanks. now I got this error message when using EasyRoad3D. this error appeared after I set lane in info tab upload_2022-5-31_13-23-9.png
     
  24. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    In which files did this error occur?
    It would be useful to let me know more details in order to understand where your project's error are coming from.
     
  25. Garik_G

    Garik_G

    Joined:
    Sep 12, 2018
    Posts:
    1
    Hi, how can i change the duration of the red light?
     
  26. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    You can only set it for green and yellow light. The red traffic light depends on them and it will change automatically.
     
    Last edited: Jul 19, 2022
  27. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    Hi Gley!
    Any news on the pedestrian system?
     
  28. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Maybe this winter.
     
    valentinwinkelmann likes this.
  29. ysundawa

    ysundawa

    Joined:
    Mar 2, 2020
    Posts:
    33
    Hi ... I got this error when switching from Bigger scene in to smaller one, seems liek the number of grids reduced, but when initiating it still refer to the old big scene, therefore index is out of bound.. because when i try to load the small scene directly, there is no error.

    IndexOutOfRangeException: Index was outside the bounds of the array.
    GleyUrbanAssets.GridManager.GetCellIndex (UnityEngine.Vector3 position) (at Assets/GleyPlugins/SharedUrbanAssets/Scripts/Runtime/Grid/GridManager.cs:180)
    GleyUrbanAssets.GridManager.UpdateActiveCells (Unity.Collections.NativeArray`1[T] activeCameraPositions, System.Int32 level) (at Assets/GleyPlugins/SharedUrbanAssets/Scripts/Runtime/Grid/GridManager.cs:204)
    GleyUrbanAssets.GridManager.Initialize (GleyUrbanAssets.CurrentSceneData currentSceneData, Unity.Collections.NativeArray`1[T] activeCameraPositions) (at Assets/GleyPlugins/SharedUrbanAssets/Scripts/Runtime/Grid/GridManager.cs:41)
    GleyUrbanAssets.UrbanManager.AddGridManager (GleyUrbanAssets.CurrentSceneData currentSceneData, Unity.Collections.NativeArray`1[T] activeCameraPositions) (at Assets/GleyPlugins/SharedUrbanAssets/Scripts/Runtime/Managers/UrbanManager.cs:33)
    GleyTrafficSystem.TrafficManager.Initialize (UnityEngine.Transform[] activeCameras, System.Int32 nrOfVehicles, GleyTrafficSystem.VehiclePool vehiclePool, System.Single minDistanceToAdd, System.Single distanceToRemove, System.Single masterVolume, System.Single greenLightTime, System.Single yellowLightTime) (at Assets/GleyPlugins/TrafficSystem/Scripts/Core/Traffic/Managers/TrafficManager.cs:336)
    GleyTrafficSystem.Manager.Initialize (UnityEngine.Transform activeCamera, System.Int32 nrOfVehicles, GleyTrafficSystem.VehiclePool carPool, System.Single minDistanceToAdd, System.Single distanceToRemove, System.Single greenLightTime, System.Single yelloLightTime) (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/Manager.cs:54)
    GleyTrafficSystem.TrafficComponent.Start () (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/TrafficComponent.cs:27)
     
  30. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    We tested what you asked about, but it worked as intended.
    In order to reproduce your problem, please send the steps you took with details and captures via email (gley.assets@gmail.com) or join our Discord channel (https://discord.com/invite/7eSvKKW) for technical support on this package.
     
  31. AbhiKana

    AbhiKana

    Joined:
    May 10, 2022
    Posts:
    1
    Hi I am getting 2 errors after following your tutorials till connect roads video. I have also created my own layers, and carpool and assigned it to the objects.

    1. NullReferenceException: Object reference not set to an instance of an object
      GleyTrafficSystem.TrafficVehicles.LoadCar (UnityEngine.GameObject carPrefab, UnityEngine.LayerMask buildingLayers, UnityEngine.LayerMask obstacleLayers, UnityEngine.LayerMask playerLayers) (at Assets/GleyPlugins/TrafficSystem/Scripts/Core/Traffic/Managers/TrafficVehicles.cs:379)
      GleyTrafficSystem.TrafficVehicles.Initialize (GleyTrafficSystem.VehiclePool vehiclePool, System.Int32 nrOfVehicles, UnityEngine.LayerMask buildingLayers, UnityEngine.LayerMask obstacleLayers, UnityEngine.LayerMask playerLayers, System.Single masterVolume) (at Assets/GleyPlugins/TrafficSystem/Scripts/Core/Traffic/Managers/TrafficVehicles.cs:62)
      GleyTrafficSystem.TrafficManager.Initialize (UnityEngine.Transform[] activeCameras, System.Int32 nrOfVehicles, GleyTrafficSystem.VehiclePool vehiclePool, System.Single minDistanceToAdd, System.Single distanceToRemove, System.Single masterVolume, System.Single greenLightTime, System.Single yellowLightTime) (at Assets/GleyPlugins/TrafficSystem/Scripts/Core/Traffic/Managers/TrafficManager.cs:197)
      GleyTrafficSystem.Manager.Initialize (UnityEngine.Transform activeCamera, System.Int32 nrOfVehicles, GleyTrafficSystem.VehiclePool carPool, System.Single minDistanceToAdd, System.Single distanceToRemove, System.Single greenLightTime, System.Single yelloLightTime) (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/Manager.cs:55)
      GleyTrafficSystem.TrafficComponent.Start () (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/TrafficComponent.cs:28)

    2. NullReferenceException: Object reference not set to an instance of an object
      GleyTrafficSystem.TrafficManager.SetIntersectionRoadToGreen (System.String intersectionName, System.Int32 roadIndex, System.Boolean doNotChangeAgain) (at Assets/GleyPlugins/TrafficSystem/Scripts/Core/Traffic/Managers/TrafficManager.cs:355)
      GleyTrafficSystem.Manager.SetIntersectionRoadToGreen (System.String intersectionName, System.Int32 roadIndex, System.Boolean doNotChangeAgain) (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/Manager.cs:283)
      GleyTrafficSystem.TrafficComponent.Update () (at Assets/GleyPlugins/TrafficSystem/Scripts/ToUse/TrafficComponent.cs:35)
     
  32. sumioka

    sumioka

    Joined:
    Sep 26, 2018
    Posts:
    8
    Hi, I recently purchased this item.
    Now I am learning how to use it.

    Please tell me about the items in the waypoint inspector.


    stop : I have confirmed that if this is checked, it is shown in waypointSetup > show stop waypoints. But I don't know how to use it. Even if I check the box, the AI car does not stop. What is the use of this?

    Please tell me how to use "speed Locked" and "cars Locked" as well.

    What is the best way to make an AI car stop temporarily at an arbitrary point?
    DisableAreaWaypoints" will make the car stop abruptly. I want to brake gently and stop.

    Thank you

    waypointInspect.png
     
  33. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    As the first errors says, there is the impossibility to load cars (TrafficVehicles, line 379). That script is a component of any driving AI car. Make sure the cars in your pool have that.

    My first recommendation is to configure and play with the test scene called City included in my package and compare your implementation with mine.

    Good luck and I hope this helps you!

    In case you do not manage, to better understand your case, please send us the steps you took until you received those errors, with details and captures via email (gley.assets@gmail.com) or join our Discord channel (https://discord.com/invite/7eSvKKW) for technical support on this package.
     
  34. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    "stop : I have confirmed that if this is checked, it is shown in waypointSetup > show stop waypoints. But I don't know how to use it. Even if I check the box, the AI car does not stop. What is the use of this?"
    -> You can modify the waypoints' characteristics only from the Window>Gley>Traffic Settings>Waypoint Setup>All Waypoints>Edit Waypoint (image attached). These will automatically modify the setup in the Inspector for those waypoints that you selected or that have rules linked to them (i.e. for speed locked). So, I recommend you to go the other way around (until now) and set it in the Gley Traffic window, not in the Inspector, otherwise the setup will be ignored.

    "how to use "speed Locked" and "cars Locked""
    ->if you want to permit a specific speed/car type in a certain area you should select the waypoints for which you want that. Once selected you set the speed value/car type and press SetSpeed/Set and it will automatically check the Speed Locked/Car Locked checkboxes in the Inspector for that waypoint.(image attatched, example values only for the sake of the demo)

    "What is the best way to make an AI car stop temporarily at an arbitrary point? DisableAreaWaypoints" will make the car stop abruptly. I want to brake gently and stop."
    -> We did not envision AI cars to stop randomly. We created rules to stop in case they are in an intersection or when they have to give way. To set the stop waypoints in the intersections, you should go to Traffic Settings> Intersection Setup> Priority/traffic light intersection and choose the waypoint of any line from the roads you want your cars to stop at.

    To save and see the modification, you should press Back and get back to the current window or press Apply Settings in the first part of the window (depending on the modification).

    I hope this information helped you have a better understanding of my work. I suggest you watch carefully also the tutorials that I've prepared. Moreover, I totally encourage you to join the Discord channel for faster support(https://discord.com/invite/7eSvKKW). For sure some community member will answer your curiosity maybe even faster and ... why not to review our work on the asset store if you appreciate and use it?:D

    You are welcome and good luck with your implementation!
    upload_2022-8-18_16-52-40.png

    upload_2022-8-18_17-6-16.png
     
  35. sumioka

    sumioka

    Joined:
    Sep 26, 2018
    Posts:
    8
    Thanks for the detailed explanation.

    I understood everything.

    I am a Japanese developer and I am customizing the Script to apply Japanese traffic rules.
    The current script can only stop at intersections and giveways, so I would like to customize it so that it can stop anywhere.

    I still have more questions, but I would like to use Discoad to continue.

    Thanks.
     
  36. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    You are welcome!
     
  37. cyeah29

    cyeah29

    Joined:
    Jan 28, 2022
    Posts:
    1
    Dear Gley Team,

    Despite following the tutorials (thanks for their quality by the way), I have an issue of certain cars not following the road connections and continue straight until colliding in buildings.

    All configured for the cars with Vehicle component with car config done including wheel colliders, CarHolder, Box colliders, Layer set to "Traffic" with physics settings well set.

    What might be the root of this issue?

    Thank you !
     
  38. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Thank you for buying our product!
    We appreciate that detailed description of your scenario with captures and video demo you sent us via our support email. We really enjoy and encourage this type of communication!

    For those who still encounter issues with their cars going straight and not following the waypoints -> make sure you press "Apply Settings" in the Gley settings window.
    And, in case your cars stop at the entering point of a road connection, make sure to press "Generate connection".

    The steps I explained above are also mentioned in my video tutorials, so make sure you watch them first.
     
  39. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Moreover, if some of your cars are going straight, you may also want to check these steps:
    1. if the other cars are working correctly, then the first thing would be to compare with their implementation.
    2. Watch carefully this tutorial video:
    Here is my explanation on how to set up your car. I emphasized especially the wheel's construction and I think that it is a better visual and audio explanation than an explanation in words here.
    3. For even a better understanding of this, I included in my package a test scene called City. There are some Sedan cars with the correct implementation, please check it out.

    I am writing it here, too, in case anyone is facing the same problem when implementing.
    However, for more technical assistance, write to our support address gley.assets@gmail.com (including your invoice number as it's stated on the asset store).
     
  40. trandai1106

    trandai1106

    Joined:
    Apr 5, 2020
    Posts:
    1
    Hi,

    Can I create a repeat map with this?
    I see the waypoint position can be changed in the editor, but the position of the grid cannot be changed. And the position of the waypoint must be inside the grid.

    Thanks very much.
     
  41. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Gley Mobile Traffic System was not intended to be used and is not supported for city builders or other games that have dynamically road generators.
    We chose to improve performance, thus there are no waypoints at runtime. All values are cached so you need to add cached values directly which is a little harder to do.

    Thank you for your interest!
     
    trandai1106 likes this.
  42. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello, @coooboy !
    May you describe your scenario with pictures you took from you scene view? Send us an email: gley.assets@gmail.com

    Please delete the invoice number because this is a public platform and that is your private key that others may use.
     
  43. Wawawa7

    Wawawa7

    Joined:
    Dec 6, 2019
    Posts:
    2
    [SOLVED]
    Hi, I just bought this asset, when i followed the youtube tutorial up to #4 Road, and i tried on City scene from this asset. but that blue & green car became like fusion, how to get distance like the end of video :


    upload_2022-12-6_12-9-15.png


    Thank you very much

    EDIT : Turnerd out i need assign the car's layer to Traffic. its work now
     
    Last edited: Dec 6, 2022
  44. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Thanks for your interest and for trusting our work!

    As you said in your last message "EDIT : Turned out i need to assign the car's layer to Traffic. its work now"[/QUOTE]

    For the others interested, please check
    -the layer setup in the video:

    -possible spawning issues and solutions:


    If you appreciate the work we put inside our package, don't be shy and leave us a review :) https://assetstore.unity.com/packages/tools/ai/mobile-traffic-system-194888#reviews

    Good luck with your implementation!
     
    Wawawa7 likes this.
  45. Wawawa7

    Wawawa7

    Joined:
    Dec 6, 2019
    Posts:
    2
    Hi, thank you for kind reply

    I am sorry but I have other problem, when i switch platform to Android. and then I play on Editor/APK, there no car spawned.
    How to fix it?

    Thank you very much
     
  46. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Make sure you:
    1. set your layer correctly (follow the tutorials)
    2. press Apply Settings in the Gley settings window and check if the the scripting define symbol related to the traffic system USE_GLEY_TRAFFIC was added - it may seem obvious, but I can assure you that this is one of the most common mistakes.

    If it does not work in the Unity editor, it will not after build too. Therefore, test in the editor first.

    Join our discord for faster support. https://discord.com/invite/7eSvKKW

    I hope this helps!
     
  47. reighlee

    reighlee

    Joined:
    Aug 16, 2022
    Posts:
    1
    Hello, I'm trying to make sloping road with EasyRoad 3.2 by the way, is there a 'set slope' on road that cars can run? Waypoint lines could be set up on a steep slope kind of road, but car stopped at a certain point. (All waypoints are connected.)
    MobileTrafficSystem spline setting.png MobileTrafficSystem car stopped.png MobileTrafficSystem waypoints connection.png
     
  48. chol-ee

    chol-ee

    Joined:
    Nov 13, 2021
    Posts:
    3
    Happy new year!.
    Thank you very much for the nice asset. I have 3 questions.
    1) I wanted 50 cars to run on the road, so I set NrOfVehicles =50, but only 7 to 10 cars were spawned near the PLAYER object. How can I show all 50 cars(Or at least 30 cars) on the road?

    2) Also, once the cars reached the end of waypoint, they just disappear, and no additional cars were spawned, so I ended up with no cars on roads. How can I make MTS respawn cars on the road?

    3) I would like to let some cars visit some places(let's say a gas station), stay there for seconds (for filling gas), and move back to the original routes, I guess I can definitely do most of works by using car types, editing waypoints and vehicle waypoint features. However, I have no idea how I can stop cars at the gas station for seconds. What would be the most handy approach to make a car type stop at some specific positions for some time?
     
    Last edited: Jan 7, 2023
  49. muhammadsufwan

    muhammadsufwan

    Joined:
    Nov 29, 2019
    Posts:
    1
    Hello,
    Can Anyone Guide me how to solve these errors
    upload_2023-1-7_15-11-57.png
     
  50. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello, @muhammadsufwan !

    In case you deleted and reinstalled MTS, please follow the instructions below:
    1. Delete folders
    GleyPlugins\SharedUrbanAssets
    GleyPlugins\TrafficSystem
    If you have only MTS installed, you can just delete GleyPlugins folder

    2. Open Project Settings -> Player, find Scripting Define Symbols and delete USE_GLEY_TRAFFIC.

    3. Reinstall MTS

    Otherwise, please write your request with the steps you took to better understand your scenario on the discord support channel (https://discord.com/invite/7eSvKKW) and check how the community members did. Or write to us via e-mail gley.assets@gmail.com
    Please include your invoice number to verify your purchase and answer your request.