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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi DannyDanielak ,

    Lines in the middle of the road are usually indeed part of the road texture. In the current version this can also be done using side objects. The additional demo package includes an example of this and the HD Roads Add On package also has presets for this.

    More on this will follow later in v3.3 since v3.3 also has new lane info options.

    Horizontal signs, do you mean the signs visible in the image in my previous post? This is v3.3 beta 7 and newer. Above I mentioned that in v3.3 it is possible to set lane info. In "General Settings > Road Types" there is a "Road Type Decals" section. One of the decal options is "Lane Direction Marking", here road type specific decals can be added. They will be spawned automatically along the road object, and near crossings the appropriate sign will be spawned matching the available directions for the specific lane at the crossing.

    The v3.3 beta package available on our website includes examples.

    Other decal types can be generated using the side objects system.

    The side object system is indeed more intended for objects along the full road object rather than only at the start or end.

    Are you using Flex Connectors now or the currently available built-in crossing options?

    Options for props like stop signs and traffic lights at Flex Connectors will be added.

    Currently built-in crossing prefabs and Custom crossings based on your own models are stored in the project folder. Stop signs and traffic lights can be added as child objects to these prefabs.

    Have you tried the current implementation of StraightXZ road sections across multiple marker sections? Will that work for you? Because adding this to Road Types (maybe optional) by itself can be done. The question is, are the results as expected?

    The Straight control type options are more intended for single marker sections. Perfect straight sections and circular sections are for example useful for creating race tracks.

    Thanks,
    Raoul
     
  2. DannyDanielak

    DannyDanielak

    Joined:
    Feb 26, 2021
    Posts:
    9
    Hey, I have tried to update to newest beta version and got this message in the console:




    URP support package fixes some shaders but not all of them:


     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi DannyDanielak,

    The v3.3 beta package is beta features related, it does not include URP and HDRP packages.

    These packages are part of the EasyRoads3D Pro package. Do you have the current EasyRoads3D Pro or demo package imported in another project? That way the respective URP package can be imported manually.

    Thanks,
    Raoul
     
    DannyDanielak likes this.
  4. DannyDanielak

    DannyDanielak

    Joined:
    Feb 26, 2021
    Posts:
    9
    Yes we are on the Pro Package. So I guess there are some shaders that URP fix does not fix cause they are not yet supported outside of beta. ok thx
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    My apologies, more is involved here.

    The console warning points to package URP_12_1_6. This package is part of EasyRoads3D Pro v3.2.2f1, released two weeks ago.

    The shaders in your post are actual additional shaders that are part of the EasyRoads3D Demo package. This package was also updated 2 weeks ago with the corresponding DEMO_URP_12_1_6 package. This package includes the specific wall and tunnel URP versions of these shaders.

    Just in case, if you already have the older demo package imported, the previous URP Demo package should also work with regard to these two shaders.

    Thanks,
    Raoul
     
  6. niuage

    niuage

    Joined:
    Nov 17, 2019
    Posts:
    89
    Hi,

    Curious if anyone tried EasyRoad with Unity 2022.2.0b9. Maybe I shouldnt have installed a beta.

    But anway, I'm getting these errors:

    Timeout while updating assemblies:Assets/EasyRoads3D/Editor/EasyRoads3Dv3Editor.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmp3af52070.tmp)
    Assets/EasyRoads3D/lib/EasyRoads3Dv3.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmpe5f2284.tmp)
    Assets/EasyRoads3D/lib/DelaunayER.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmp21e044d0.tmp)

    Timeout while updating assemblies:Assets/EasyRoads3D/lib/DelaunayER.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmp2942e8a3.tmp)
    Assets/EasyRoads3D/lib/EasyRoads3Dv3.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmp25142866.tmp)
    Assets/EasyRoads3D/Editor/EasyRoads3Dv3Editor.dll (Output: C:\Users\niuage\AppData\Local\Temp\tmp55df56ec.tmp)

    The tmp files are empty.

    URP version: 14.0.3
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi niuage,

    I will have check Unity 2022.2.0b9 but what is the history of this project? Is this a new project?

    And which exact version of EasyRoads3D is imported?

    Thanks,
    Raoul
     
  8. niuage

    niuage

    Joined:
    Nov 17, 2019
    Posts:
    89
    Using 3.2.2f1, and yes, it's a fresh project! Thanks.
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    We installed the latest 2022.2.0b9 and created a new project. The EasyRoads3D Pro package completes without issues, the same like in previous 2022.2.0 beta releases. There are no warnings or errors in the console.

    Have you tried removing the EasyRoads3D folders, then in the Package Manager first click "Re-Download" and "Import" afterwards?

    There are some changes though in the 2022.2 beta which we are monitoring and for which there are already workarounds in the current EasyRoads3D anyway at the moment. But the package import seems to still work well.

    Thanks,
    Raoul
     
  10. niuage

    niuage

    Joined:
    Nov 17, 2019
    Posts:
    89
    Ok thanks. I guess it's good that there's no issue with the import but it's unfortunate for me ^^. I'll try again later, but I already had tried deleting everything, redownloading etc.
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    I don't know if that will work, but before opening the Unity Package Manager and downloading again, have you tried removing the specific files completely from the path in your original post? And also from C:\Users\niuage\AppData\AppData\Roaming\Unity\Asset Store?
     
  12. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hey Raoul,

    guess I found a small problem. when you have a procedual mesh sideobject that is using a source prefab that is using one of unitys build in meshes (like quad) it will load forever after you click apply in the mesh editor window OR try to generate the sideobject. probably because this mesh is not read/write enabled? maybe adding a error message would be great instead having it to load infinite...
     
    mafole4x likes this.
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hey Marcell,

    In your example you mention the Quad, the assigned mesh to this built-in primitive type has no depth. That will not work for the procedural side object type where the prefab is regenerated repeatedly along a spline in a single mesh.

    Have you tried with for example a plane primitive? A quick test shows that this works well.

    I will make a note to add a warning message when this type of mesh (no depth) is selected for a Procedural side object type.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  14. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    Is there a preset library of common road types available?
    When I start a road, there's only the default type listed.
     
    Last edited: Oct 7, 2022
  15. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    In Unity 2021.3.9 HDRP, I cannot open the road Settings or Marker Settings menus.
     
    Last edited: Oct 7, 2022
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi XyrisKenn,

    EasyRoads3D is a framework that can be used with your own road type and side object assets. That is why the EasyRoads3D Pro package itself includes limited additional assets.

    Additional road type and side object assets are available in the free (if you have EasyRoads3D Pro) demo package, https://assetstore.unity.com/packages/tools/terrain/easyroads3d-demo-project-105045. This package is intended for learning purposes, it is recommended to import it first in a new project.

    and more road type presets are available in the HD Road Add On package https://assetstore.unity.com/packag.../roads/easyroads3d-pro-add-on-hd-roads-118774


    HDRP is more material / shader related, the functionality of the asset itself is the same between all render pipelines.

    Which "Road Settings" and "Marker Settings" menus cannot be opened? Are these the respective sections in the Inspector after selecting a road object in the scene? Do the sections not expand after clicking the arrow or the section title? Do you see error messages in the console?

    Thanks,
    Raoul
     
  17. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    Hi Raoul, thank you for your links and insights.

    Yes, this is in the inspector after adding roads. I can open the other dropdown menu items.
    I used Real World Terrain and Easy Roads integration, and Vegetation Studio Pro is also in the project.

    Thinking RWT might be interfering, I deleted the old road network and made my own, but the problem of not being able to open settings dropdowns persists.
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi XyrisKenn,

    If we are referring to the same, there are no known issues with that so it is hard to give feedback at this point.

    There are 3 to 4 (when side objects are active) other similar sections: Side Objects, Marker Side Object Settings, Add Shape to Terrain Splatmap, Cam Fly Over. Do these sections expand, collapse well?

    What are the exact steps you take, and what are you clicking on?

    Do you see error messages in the console?

    Since you mention other assets perhaps interfering, have you tried this in a new fresh project? Does that work? Can the problem be isolated this way?

    With regard to the packages RWT and Vegetation Studio Pro, these two package are known to work well with EasyRoads3D Pro.

    You can always send us the project by email so we can look at it on our end.

    Thanks,
    Raoul
     
  19. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    The next day after other work in the project and after importing these great add-on roads, the UI is acting perfectly, no issues. No doubt there was an unrelated asset causing the trouble. Thanks for your advice Raoul.
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi XyrisKenn,

    Glad to hear the Inspector is responsive now.

    This is OnInspectorGUI() related which primarily is based on the Unity scripting API. The only reason I can see why this does not work in a specific situation is because of errors stopping the full code execution. That is why I asked if you can see red error messages in the console.

    Anyway please let me know if this happens again, perhaps than you will also have more feedback about the state of the specific project.

    Thanks,
    Raoul
     
    XyrisKenn likes this.
  21. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    Thank you Raoul. It’s great to be able to snap roads together so easily now.
    Currently my roads aren’t 100% above the terrain with follow terrain activated, nor are they clearing Vegetation Studio Pro trees - so I have reading to do!
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi XyrisKenn,

    There are some limitations regarding the Unity terrain object, especially the fact that it is based on an heightmap with a specific resolution and size. And it is impossible to add detail points. So the larger the cell size the more limited you will be with abrupt road shape height changes. Default terrain settings should work well though.

    The Troubleshooting page in the manual covers all this and other limitations and how to deal with them.

    Regarding Vegetation Studio, were you able to get this to work meanwhile?

    Vegetation Studio support is activated in General Settings > Terrain Management. And in this sections the default perimeter values can be set. The same values can be adjusted per road type in General Settings > Road Types and also for each individual road object after selecting the road object in the scene. Especially the last option can be used to quickly see results, the specific Vegetation Studio component will update after each change in the Inspector.

    Thanks,
    Raoul
     
  23. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    91
    Many thanks, Raoul.
     
    raoul likes this.
  24. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    Hey everyone.

    Anyone else encounter an issue where creating a road on runtime makes the road flipped upside down? Raycast hits the terrain properly, creates the road, adds the markers (I can switch to SceneView and manipulate the road as normal), but the road is displayed on the "bottom" of the terrain, not on its "proper" upper side.

    I'm running it in Unity 2021.3.11f1. EasyRoadsPRO is the latest. Installed a day or so ago. Running it in URP.

    Thanks!
     

    Attached Files:

  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi DanijelM,

    There are no known issues with road objects being created upside down through the scripting API, so perhaps you can give more info.

    What code is used?

    Is this road object based on a specific road type? In that case, does it work well when creating the road object manually in the Unity editor?

    Thanks,
    Raoul
     
  26. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    Hi Raoul and thanks for the help!

    This is the code. As simple as possible. Just testing it out.

    Code (CSharp):
    1. private void Update()
    2.         {
    3.             if (Input.GetKeyDown(KeyCode.R))
    4.             {
    5.                 Debug.Log("Trying to place road");
    6.                
    7.                 if (road == null)
    8.                 {
    9.                     ERRoadType roadType = roadNetwork.GetRoadTypes()[0];
    10.                     road = roadNetwork.CreateRoad("road1", roadType);
    11.                 }
    12.                
    13.                 Vector3 newMarkerPos;
    14.                 RaycastHit hit;
    15.                 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    16.                 if (Physics.Raycast(ray, out hit, Mathf.Infinity))
    17.                 {
    18.                     Debug.Log("Hit terrain");
    19.                     newMarkerPos = hit.point;
    20.                     road.AddMarker(newMarkerPos);
    21.                     //road.SnapToTerrain(true, -0.2f);
    22.                 }
    23.             }
    24.         }
    The road type is set in code as well, simply as the first "default" road available. When placing it via the editor, everything works as expected.

    Are the normals perhaps flipped? Can I flip them back manually somehow?

    I don't know if it's important, but I'm using MapMagic2 to generate the terrain. Though the same is used when placing the road via the editor. Tried it on a standard terrain with the same effect.

    There's only one problem when using the editor, but that's linked to dual monitor setup. For the "Shift+click" to properly work, I need to reset the layout to "Unity default" otherwise the "shift+click" automatically selects the terrain. I've had the same issue on another plugin so that's not surprising.
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621

    Hi DanijelM,

    What is the setup of this road type?

    Does the same happen when creating the road object by passing a Vector3 array of marker positions in CreateRoad()? Something similar as in the runtimescript.cs example in /Assets/EasyRoads3D/scripts/

    Do you mean the road types are created through the scripting API or is this more referring to line 9 in your code and is this an already existing road network object in the scene with road types already prepared in: General Settings > Road Types?

    Inside the editor there is a "Flip Normals" option, but this is more related to custom road shapes and custom connections which can result in flipped normals when the road shape is not symmetrical. This "Flip Normals" option can be added to the scripting API, but I still wonder what is causing this on your end.

    Thanks,
    Raoul
     
  28. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    The road type for the runtime created road is set via code, but the road type itself is pre-made. It is literally the "default road" that comes with Easy Roads.

    I'll try the Vector3 array approach. Though if memory serves, I had no such issue with your runtime demo scene using the script you noted.
     

    Attached Files:

  29. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    Hi,

    Tried a few things:
    1)Creating a road using
    Code (CSharp):
    1.  
    2. Vector3[] markers = new Vector3[markersList.Count];
    3.  for (int i = 0; i < markersList.Count; i++)
    4.    markers[i] = markersList[i];
    5.                
    6. ERRoadType roadType = roadNetwork.GetRoadTypes()[0];
    7. road = roadNetwork.CreateRoad("road1", roadType, markers);
    8.  
    So, populating an array of markers and then passing it into CreateRoad works it seems as intended, much like the example in runtimescript.cs.

    2)Doing this however doesn't:
    Code (CSharp):
    1.  
    2. Vector3[] markers = new Vector3[markersList.Count];
    3. for (int i = 0; i < markersList.Count; i++)
    4.    markers[i] = markersList[i];
    5.  
    6. if (road == null)
    7. {
    8.     ERRoadType roadType = roadNetwork.GetRoadTypes()[0];
    9.     road = roadNetwork.CreateRoad("road1", roadType);
    10. }
    11.  
    12. road.AddMarkers(markers);
    13.  
    Creating a road separately (with no markers), then using AddMarkers results in the road being upside down / being displayed upside down.
     
  30. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    OK. Tried another thing. So with the road flipped, but there, during playmode, went into scene view->road properties and used the Flip normals button on the inspector. That basically did the trick. Now, the road is facing up as intended.

    The only thing I'm missing though is an exposed function for that :).

    Hope this helps!
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi DanijelM,

    Yes, that will fix it, but is obviously not a solution at runtime.

    I will make a note to add the "Flip Normals" option to the scripting API.

    And I can confirm the issue with the code you posted. It will be fixed.

    For now, is creating the road object once the first marker is known an option? As you also wrote, that will work. And after that both AddMarker() in your original code and AddMarkers() in your last post, will also work well.

    Thanks,
    Raoul
     
    hopeful likes this.
  32. DanijelM

    DanijelM

    Joined:
    Dec 20, 2017
    Posts:
    20
    Hi!

    Yep. I'll use the workaround until the fix. No problem.

    Thank you very much!
     
    raoul likes this.
  33. mafole4x

    mafole4x

    Joined:
    Dec 15, 2015
    Posts:
    6
    Hi, Raoul.
    I am getting this error when building the terrain for the roads.

    Error::
    Code (CSharp):
    1. MissingMethodException: Method not found: void UnityEditor.Unwrapping.GenerateSecondaryUVSet(UnityEngine.Mesh)
    2. EasyRoads3Dv3Editor.ODDDOCQCCC.OnInspectorGUI () (at <65f95bacf55e40c6b38f48676f5e71aa>:0)
    3. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass62_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <37cb8c53a0534d66a15ae9af2e68d064>:0)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    5.  
    Tools::
    Editor: Unity Editor 2022.4.f1
    Package: Easy Road Pro v3

    NB: It builds forever when the build terrain is clicked.
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hello mafole4x,

    Do you mean Unity 2022.1.4f1?

    In that case, this same error appeared when we were testing early 2022 beta releases and was fixed in the EasyRoads3D package for Unity 2022. So first thoughts are that maybe the package for a previous version of Unity is imported. What is the history of this project and your projects using EasyRoads3D Pro?

    Can you open the Package Manager, force a new download of EasyRoads3D Pro from the Asset Store and import this package.

    Does that work better?

    Thanks,
    Raoul
     
    mafole4x likes this.
  35. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    So... MicroVerse. Thoughts? Some exciting possibilities with it -- like real-time non-destructive terrain modification and vegetation clearing. If you haven't had a chance to look at it yet, at least take a look at the videos Jason has put together. It's a game changer.

    I'd even pay for MV integration as an add-on module to ER3D. That's a pricing strategy suggestion, not looking for it any time soon. When I find some time I'm going to play with the MV spline implementation and try to hook it up to the ER3D data.
     
    solkyoshiro and Vagabond_ like this.
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi Colin,

    I think this is indeed about accessing spline data and spline data changes and generate the road objects through the scripting API. I will see if I can find out more.

    Thanks,
    Raoul
     
    colin_young likes this.
  37. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,145
    I did ask a while ago and i really wanted to do it again recently and now it's probably a good moment
    I know it's not an easy task but we really need a non destructive and fast way of adjusting terrain to roads.

    Here's a gif showing a road generator i wrote based on Unity Splines and working with Microverse splines. It needs a lot of work though. Anyway i will really love to see that kind of heightmap adjusting in EasyRoads3D

    MV_Spline_Plus_RoadGenerator.gif
     
    tosyk_tsw, CitrioN and colin_young like this.
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi Vagabond_,

    We worked on prototypes before. The issue at that moment was processing time on complex terrains, high heightmap resolutions, dense vegetation, and also updating terrain splatmaps.

    At the moment the focus is on releasing v3.3. After that it is back on further terrain related improvements, I will make a note to look into this again.

    Thanks,
    Raoul
     
    Ryan-Hayle, colin_young and Vagabond_ like this.
  39. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,200
    API name changes.

    Hey @raoul I notice that GetRoads() seems to have changed to GetRoadObjects().

    Do you know of any other methods that have changed since 3.1.9? I'm just updating Landscape Builder to make sure it is fully compatible with the latest version.

    Also, what's the minimum version required for GetRoadObjects()?
     
    Last edited: Oct 24, 2022
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi @sstrong,

    That changed in 3.2.1f3

    What also changed:

    GetSourceConnectionByName() > GetConnectionPrefabByName()

    SetFollowTerrainContoursOffset() > FollowTerrainContourThreshold()

    SetRightIndent() and SetLeftIndent() > SetIndent(float value, int markerIndex, ERRoadSide type)

    SetRightSurrouding() and SetLeftSurrouding() > SetSurrounding(float value, int markerIndex, ERRoadSide type)

    Thanks,
    Raoul
     
    sstrong likes this.
  41. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,200
    Thanks for the timely response, Raoul.
     
    raoul likes this.
  42. Skaltum

    Skaltum

    Joined:
    Nov 1, 2013
    Posts:
    28
    Hello,

    Is the import OSM function available at runtime through the API or is it editor only?
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hello Skaltum,

    OSM import is currently only available inside the Unity editor.

    It is fairly easy to add the scripting API, but how do you want to use this? I am asking that because this currently works by selecting a local osm data file.

    Thanks,
    Raoul
     
  44. Skaltum

    Skaltum

    Joined:
    Nov 1, 2013
    Posts:
    28
    Providing a file path would be fine for me at runtime.
    The API might be more flexible if an XML string could be provided.
    Thereby leaving the loading of OSM data to the user.

    I haven't thought about georeferencing the scene yet.

    Thanks,
    David
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Ok, I will add this to the scripting API

    Thanks,
    Raoul
     
  46. FuhaoXie

    FuhaoXie

    Joined:
    Nov 18, 2016
    Posts:
    26
    Hi,
    I am currently using EasyRoads3D Pro v3.2.2f1.
    All the SideObject prefab connection will be brake after build the road.

    WeChat Screenshot_20221105012127.png

    So I have to diable the "Build Side Objct in Editor mdoe" and enbale it. the side objct with road will re-become prefab, but sideobject solo will never become prefab, have to disalbe and enbale one by one.
    WeChat Screenshot_20221105011841.png

    the side object setting seem to be correct.
    What I need is to keep the prefab connection all the time. Is there any way workaround to do rightnow by coding?

    WeChat Screenshot_20221105011947.png
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Hi FuhaoXie,

    That is correct, when working on the road network in Edit mode the side objects are created correctly through the PrefabUtility class with the connection to the original prefab in the project folder.

    When switching to Build Mode these instances are in the current version not generated through the PrefabUtility class (the workflow for runtime side object generation), so the connection to the prefab in the project folder no longer exist.

    This is fixed in the next update. Let me know if this is urgent for you, I can already prepare a build and send it to you. In that case, please pass the Unity version that you are using.

    Thanks,
    Raoul
     
  48. FuhaoXie

    FuhaoXie

    Joined:
    Nov 18, 2016
    Posts:
    26
    Yes it is somehow urgent for me. It would be helpful to give me a hotfix. I am currenli inusing unity 2020.3.40f1c1.
    You can send build to my email: xiefuhao@gmail.com.
    Thank a lot!
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,621
    Ok, I will send an update tomorrow

    Thanks,
    Raoul
     
  50. FuhaoXie

    FuhaoXie

    Joined:
    Nov 18, 2016
    Posts:
    26
    Hi raoul,
    I have recv the update , thanks very much.
    Prefab connection will keep what ever build road or back to editor.
    but if I do it from code, like this: Prefab connection is still brake.
    Code (CSharp):
    1.             if (m_roadNework.roadNetwork.terrainDone)
    2.             {
    3.                 try
    4.                 {
    5.                     m_roadNework.RestoreRoadNetwork();
    6.                 }
    7.                 catch(Exception exp)
    8.                 {
    9.                     Debug.LogError(exp.ToString());
    10.                 }
    11.                 //Debug.Log("hasRestore");
    12.             }
    13.             m_roadNework.roadNetwork.treeDistance = 0;
    14.             m_roadNework.roadNetwork.detailDistance = 0;
    15.  
    16.             bool doSplatmaps = m_roadNework.roadNetwork.doSplatmaps;
    17.             m_roadNework.SetRaiseOffset(raiseRoadNetWork);
    18.             m_roadNework.BuildRoadNetwork(doSplatmaps, true, true);
    Is there way to keep it by using code building road?