Search Unity

EasyRoads3D v3 - the upcoming new road system

Discussion in 'Works In Progress' started by raoul, Feb 19, 2014.

  1. HeloiseL

    HeloiseL

    Joined:
    Apr 25, 2019
    Posts:
    4
    Yes the "build terrain" option worked with only one terrain, with or without vegetation on it.
    Thanks for your answer, I was also wondering, is there any way to try out intersections between roads in the free version?
     
    raoul likes this.
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    The free version does not support intersections at the moment. The Pro version supports X and T intersections, more is coming in v3.3, https://easyroads3d.com/v3alpha.php , including motorway on / off ramps. It is also possible to import your own intersection models in the system.

    Thanks,
    Raoul
     
  3. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    610
    hi i recently have been looking into finally using easyroads 3d pro.. im looking to find either already made or build an off ramp for the motorway. is there a good tutorial or premade asset you can point me at for making this type of intersection.
    thank you

    edit-just noticed your last post... i guess ill wait for those new motorway pieces, but any info on making intersections would still be appriciated..
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi JBR-games,

    Yes, on off ramps will be built-in in v3.3 but that still requires some work.

    Regarding making making them yourselves and importing them into the system, have you made intersection prefabs before and imported them into the system? If not, then it is recommended to start with some simple intersections to get a feel of how this works.

    Unless the road objects connected to these motorway and exit prefabs are always flat and at the same height, what is important is the direction of the ramp connection and the position relative to the motorway. When they are parallel pointing in the same direction then the connection position must be far enough away of the motorway (sideways) so at least one terrain point is between the two. The minimum indent values in General Settings > Scene Settings can be used as a reference. When that is not the case then the terrain will probably break through part of the motorway or the exit lane when they are not at the same height and right next to each other.

    Thanks,
    Raoul
     
    JBR-games likes this.
  5. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Hi Raoul!

    I tried using Easy Roads in unity 2019.3 and I keep getting the terrain selected when i mean to click to add a new node. I used a fresh new project and it only has Easy Roads directly from the asset store, with the version published as of today, February 7th. I tried adding the terrain to the "scene objects control" just to see if that would fix it but the behavior remained.

    Is there something I'm missing or is Easy Roads not tested yet on this new Unity version?
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi Alberto,

    We have been working over the past months with Unity 2019.3 to integrate tunnel support using the new terrain holes system in v3.2. Beta versions are available. The current v3.1.9f3 released earlier this week also works with Unity 2019.3.

    Do you mean none of the events are fired? Can you select existing markers?

    A while ago we came across a situation where a user had similar issues, non of the Unity events were triggered. It turned out to be related to the Unity editor. Resetting the editor for example back to the factory settings in Window > Layouts resolved it. Afterwards the editor can be customized again.

    Have you tried that? Does everything work well in a new project with default editor setup?

    The "Scene Objects Control" is a new feature for objects like water. They will be handled in a similar way as the Unity terrain object, selectable by double click when the road network is selected. Single click will keep the road network selected. It is not necessary to add the Unity terrain object here.

    Thanks,
    Raoul
     
  7. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Fantastic, that did the trick! Thank you so much for the quick reply :)
     
    raoul likes this.
  8. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,120
    I wanted to create a transition from sunny day to stormy day. I used MicroSplat for the terrain wetness. However the only thing that was lacking wetness was the wetness of the road. So I asked @Vondox and he quickly coded an adapter, so that the road wetness is influenced by the Enviro weather. I thought it might be of use for others, so in case anyone else wants it, the script is attached.

    Looks like this in action:



    e. g. for Dirty Road you can configure it like this:

    usage.jpg

    Another screenshot:

    wetness.jpg
     

    Attached Files:

    Last edited: Feb 8, 2020
    hopeful and raoul like this.
  9. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Hi Raoul!

    Back with another question.

    I'm trying to make an Armco barrier that can have smooth normals like my original mesh, but i keep getting this result of hard normals on the start/end pieces, and then an odd orientation on the lofted section. What could I be doing wrong? My original mesh has smooth normals all across the object.

    upload_2020-2-8_11-0-51.png upload_2020-2-8_11-1-13.png
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi Alberto,

    The mesh is cut in pieces and rebuild / repeated along the spline,smooth normals on the original prefab between the start mid and end sections need to be recreated.

    Could you send the prefab so we can test it?

    Thanks,
    Raoul
     
  11. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Absolutely, here it is!
     

    Attached Files:

  12. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Hi Raoul,

    I ran into another scenario where i'm not sure if i'm encountering a bug or i'm doing something wrong. It's worth mentioning that my tests have been in the latest alpha for 3.3, so maybe these behaviours are different from the asset store version?

    I'm trying to make a "shape object" for the left, and one for the right. The left one is created on the left side of the road and it works as intended, however, the right one, with the exact same settings but mirrored, creates a an object on both the left side and the right side. I'm puzzled, here is my setup, and the result.

    upload_2020-2-8_14-11-46.png
    upload_2020-2-8_14-12-0.png

    upload_2020-2-8_14-13-50.png

    upload_2020-2-8_14-13-57.png
     
    Last edited: Feb 8, 2020
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi Alberto,

    The v3.3 alpha also includes the v3.2 beta updates.

    v3.2 is side object related, mainly auto generating side objects based on rules. This takes one side object as the input, it will be used on both the left and right side of the road. This does work well for auto generated side objects. But indeed, for manually placed side objects it will also generate a mirrored version on the other side. This is a bug that is fixed in the next update.

    The next 3.2 beta update also supports one side object for both the left and right side for manually placed side objects. When a side object is aligned to either the left or right side of the road, the Inspector will automatically also display side object options for the other side of the road for the same side object.

    Thank you for posting the zip, I will look at your model today.

    Raoul
     
    AlbertoMastretta likes this.
  14. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    Hey, I've come back to this and I'm unfortunately I'm still struggling with this. I seem have all the settings in place. In this screen shot you can see an individual road's settings, but still you can see I have trees on the road. What step am I missing?
     

    Attached Files:

  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hello donkey0t,

    Last week I have looked into Vegetation Studio trying out the road module posted by Rowlan on the previous page. This also involves Vegetation Studio. There were no issues with Vegetation removal. So in general everything Vegetation Studio related works well in the current version.

    From an EasyRoads3D point of view, the mask Line component is clearly created. From then on it is Vegetation Studio. It is hard to comment further on this, can you email a link to the project so we can look at it?

    Thanks,
    Raoul
     
  16. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,120
    These are my settings:

    settings.png

    Try presseting the "Reset All Road Types And Objects".

    And what's in the mask:

    mask.png
     
    donkey0t likes this.
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    @AlbertoMastretta,

    Mesh.RecalculateNormals() is used on the generated side object mesh along the spline. RecalculateNormals() directly on the armco2 fbx has the same results, non smooth normals. This mesh counts 476 vertices, visible in the Inspector. Looking at the fbx there are only176 vertices. It is not unusual that the final Unity mesh after import has more vertices but it appears this is what is causing the problem.

    An option "Weld Vertices" for vertices at the same position can be added to the Side Object options to force smooth normals in situations like this.

    Thanks,
    Raoul
     
  18. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    Thanks for the replies Raoul,

    I investigated my mesh and attempted to clean it up, unsuccessfully. So I decided to try again with another shape, this time a sphere to which I extruded a middle section to it. All normals are merged, uv maps were generated using planar projection so even the UVs are welded. No vertex colors, smooth normals all across the object. Here are my results, it still has the same problem.

    I tested this on v3.1.9.f3 and v3.3a1

    upload_2020-2-9_11-30-4.png
    upload_2020-2-9_11-30-39.png
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi Alberto,

    The pics show different vertex counts, 146 and 168. So RecalculateNormals() can have different result. The same applies here I would say.

    Thanks,
    Raoul
     
  20. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    69
    I checked the guard rail that comes with Easy Roads. The vertex count is also different between the FBX and the mesh inside of unity, however, those guard rails don't have this problem. The vertex count disparity on that guard rail is even bigger than the extruded circle.

    My guess is that that the vertex count disparity is not the cause of the problem with the normals.

    upload_2020-2-9_13-9-31.png
    upload_2020-2-9_13-9-39.png
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    It depends on which vertices are duplicated. If the dupliated vertices of your armco2 fbx are welded so the total is also 176 vertices, the normals will most likely be smooth. This option will be added.

    Thanks,
    Raoul
     
  22. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    Thanks, I have exactly the same settings and pressed the 'Reset All...' but still the vegetation persists on the road. Is this because the there is another Veg Mask overlapping the road? Do you have to 'Bake' the road for this to work?
     
  23. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    As you can see here, I've got an overlapping grass mask. If I adjust the mask to not cover the road it all works, but move the mask back to the road and it breaks. It's appear like the road's mask is been ignored.??
     

    Attached Files:

  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    The setti
    The perimeter settings of 0 means that vegetation will only be removed that is exactly on the road.

    Your previous screenshot showed that the vegetation mask Line component is added to the road, this is what EasyRoads3D does also passing the perimeter values. It shows different perimeter values per vegetation type which is not a problem. All this is Vegetation Studio related, the circle shaped lines are drawn by Vegetation Studio, not by EasyRoads3D.

    Looking at these pics this appears to be setup correctly, it is hard to give further feedback with the current info. It would help being able to look at it.

    Do manually placed Vegetation Mask Line components work well?

    Do you mean the other grass mask is interfering? How is that mask generated?

    Thanks,
    Raoul
     
    Last edited: Feb 10, 2020
  25. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    236
    Hi.

    A simple question

    Why does the ROAD WIDTH value deactivated appear on some occasions?

    Thanks
     
  26. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    FYI I got to the bottom of this, the problem is that the roads and veg are generated by another 3rd party tool. That tool creates Veg' Studio Masks. Unfortunately, as suspected, they don't play well with Veg Mask Lines. Anything in a Veg Mask Include section will always take precedence over whatever is in being excluded in the Mask Line.
     
    raoul likes this.
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi Barritico,

    That is the case when a road type is assigned to the road object, which is recommended. In that case the road width can be changed in General Settings > Road Types. "Update Scene Instances" near the bottom in the road type settings will update all roads in the scene using that road type.

    "Road Width" is also disabled when the road is attached to a crossing. But when crossings are involved it is even more recommended to work with road types. The road network will be better manageable in exactly this type of situations when for example a road width is changed.

    Thanks,
    Raoul
     
    Barritico likes this.
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi donkey0t,

    Does the same happen with the Biome Mask component?

    Thanks,
    Raoul
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    @AlbertoMastretta,

    The reason why the vertex count increases from 176 to 476 is related to the way it is unwrapped.

    Attached is a mesh asset with all vertices (except those with different vertex colors) at the same position merged. This will have smooth normals like the original prefab.

    Thanks,
    Raoul
     

    Attached Files:

  30. joe_ftg

    joe_ftg

    Joined:
    Nov 9, 2015
    Posts:
    39
    Hi Raoul

    Sometimes we get the following exceptions. It seems it occurs if we load some scenes containing terrains additively, and then load the scene containing the road network (again additively). We're able to work around it by loading the roadnetwork first, but would be nice if it could be fixed in the future. We're using Unity 2018.4.2f1 and the latest version of Easyroads released a week ago

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERModularBase.OQOOCDQCCC (System.Boolean& multTerrainResFlag)
    EasyRoads3Dv3.ERRoadNetwork..ctor ()

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERModularBase.ODQCCOQOQQ (System.Boolean& multTerrainResFlag)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OnEnable ()
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi joe_ftg,

    What are the exact steps to reproduce this?

    Thanks,
    Raoul
     
  32. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    Biome Masks are fine, I've written a script that converts Veg' Masks to Biome Masks and the problems go away.
     
    raoul likes this.
  33. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    New question. Roundabouts. I'm getting a number of exceptions when I try to create roads from a roundabout. If I try to connect to a roundabout I just get the dreaded red light. Any idea what's happening here?


    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OQDCCODDDC (UnityEngine.Vector3 pos, EasyRoads3Dv3.ERModularBase baseScript, EasyRoads3Dv3Editor.OQQDDDQQDC eScr) (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.ODQDQOQQCO (UnityEngine.Vector3 pos, System.Boolean ODCODDOCCD, UnityEngine.Event cEvent, EasyRoads3Dv3.ERModularBase scr, System.Boolean dragStageFlag) (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OnSceneGUI () (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3292)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2539)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2400)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:281)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Is that still related to EasyRoads3D? Just in case, Biome masks are supported and can be added directly to the roads.

    Thanks,
    Raoul
     
  35. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    Yes and no. Yes - Veg Mask Lines should be used with ER and they don't work with Veg Masks. No - none of the tech involved is a responsibility of ER. But it might be worth noting this 'issue'.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Yes, it is worth noting the issue between Vegetation Masks and Vegetation Mask Lines, thank you for sharing that info. But in what way should Veg Mask Lines be used with ER? EasyRoad3D supports both Vegetation Mask Lines and Biome Masks.

    Thanks,
    Raoul
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Roundabouts is not entirely stable at the moment but that is related to building / setting up the roundabout.

    If not, I just tested this with the provided roundabout prefab, both pulling out new roads and connecting existing roads works without errors. How can this be reproduced?

    Thanks,
    Raoul
     
  38. HeloiseL

    HeloiseL

    Joined:
    Apr 25, 2019
    Posts:
    4
    Hi Raoul,
    After getting easy roads 3D pro, the connection prefabs do not appear in the intersection tab. However they are present in project's folders. Is there a way to solve that issue so that I can use the intersection prefabs already present in the project?
    Thank you in advance !
     
  39. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    28
    FYI If anyone needs a clunk conversation script from Vegetation Masks to Biome Masks you can grab it from here; https://pauliom.com/2020/02/11/convert-vegetation-studio-pros-vegetation-mask-to-biome-mask/
     
    raoul likes this.
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi HeloiseL,

    Are these Pro / demo package prefabs or HD Roads Add On prefabs? For HD Roads Add On prefabs, was EasyRoads3D Pro imported first? Can you try removing the prefabs from /Assets/EasyRoads3D/Resources/custom prefabs/ and then reimport the HD Roads package? Does that solve the problem?

    Thanks,
    Raoul
     
  41. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    426
    Raoul,

    I am getting an error as I iterate through roads in code.

    Code (CSharp):
    1.  
    2. foreach (ERRoad road in roads)
    3.         {
    4.             int lanes = road.GetLaneCount();  //error happens here
    5.  
    6.  
    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERRoad.GetLaneCount () (at <a7d1335a4a7c4a82866879487b0913c3>:0)
    ER3D_Traffic.CreateRoadEntities () (at Assets/HBC/Scripts/ER3D_Traffic.cs:123)
    ER3D_Traffic.Start () (at Assets/HBC/Scripts/ER3D_Traffic.cs:54)

    I even had a check to see if the "road" object was null, but it still happens. When I wrap the line in a Try..Catch
    Code (CSharp):
    1.  
    2.             try
    3.             {
    4.                 lanes = road.GetLaneCount();
    5.             }
    6.             catch (System.Exception ex)
    7.             {
    8.                 Debug.Log(road.GetName() + " " + ex.Message);
    9.             }
    I get: "Object reference not set to an instance of an object"

    I have rebooted my machine and Unity multiple times, and still the issue persists. I am looking at what I believe is the correct road object in the Hierarchy and cannot see any differences between it and all the other roads that are not throwing an error.

    Any Ideas?
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi James,

    So road is null in line 8? What does the roads array represent? Is this returned by ERRoadNetwork.GetRoads()?

    Or what is the error after wrapping it in Try Catch?

    Thanks,
    Raoul
     
  43. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    426
    Yes, the road array is from these two lines of:
    Code (CSharp):
    1. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    2.         ERRoad[] roads = roadNetwork.GetRoads();
    The error in the try/catch is: "Object reference not set to an instance of an object"

    edit: The road is not null at any time.
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    So it is known for which road this happens?

    There is no known issue with GetLaneCount() in the current v3.3 alpha build. Is the assigned road type all setup including v3.3 road shape data with lane info? Looking at the code this could throw a NullReferenceException when the road type is not v3.3 ready. I will make sure that will throw a proper message. Other then that looking at your code all should be fine. It will only return the number of lanes set for the assigned road type.

    Thanks,
    Raoul
     
  45. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    426
    FYI: This is with the alpha of v3.3, sorry I should have said that sooner.

    I'll try to replace the road and see if this goes away. I'll let you know what I find out.
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    I was referring to v3.3 alpha too, v3.3 road type changes specifically, AI lane data is v3.3.

    You can try replacing the road, but it would be interesting to know what the actual problem is if the ERRoad reference itself is not null. There is only a couple of lines of code in GetLaneCount(), road type related.

    Thanks,
    Raoul
     
  47. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    426
    The odd thing is, when I selected this road in the Hierarchy it was not highlighted in the Game. I deleted it and THAT error is resolved... I BELIEVE.

    The next question I have is; Is there a way to run "Clear Lane Connections" and "Reset Lane Connections" in bulk, as opposed to selecting each connection, then pressing those buttons.
     
  48. PrimusThe3rd

    PrimusThe3rd

    Joined:
    Jul 3, 2017
    Posts:
    24
    Hi, sorry if it is too noob question, but here it is. :) How can I make transparent textures ..let's say if the roads are placed in the sky...riders will see through it (semi transparent). Regards, Primus
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934
    Hi James,

    Were the roads created manually in the Unity editor or through the scripting API? Perhaps the road was created but no markers were added so there is no actual road mesh? But that would not explain the NullReferenceException. Road types are added when the road is created.

    "General Settings > AI Traffic" includes a "Reset All Connections" button.Clear Lane Connections" can be added.

    I will also add options for this to the scripting API.

    Thanks,
    Raoul
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,934

    Hi PrimusThe3rd,

    That is more material related. Either a shader can be used with control over transparency when the opacity level is the same for the full material. Otherwise the opacity level can be defined in the alpha channel of the texture and use Transparent for the rendering mode in the shader settings.

    Thanks,
    Raoul
    .
     
unityunity