Search Unity

EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi marcrem,

    The grid option is indeed based on a fixed radius. A control to customize it can be added. I will see if it can still make v1.8

    Thanks,
    Raoul
     
  2. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Is the I-Connector supposed to work like this? Encountering several issues (including undo not working at all).


     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Thomas,

    The I Connector can be used to connect two different road types. In your setup an additional transition mesh is created based on the "Connector Distance" value (which is by default 0) and the assigned material.

    The purpose of this is more short transitions like done in the demo package:



    http://unityterraintools.com/tutorials/connecting_roads.php

    I Connector transitions are not really suitable for a 4 lane road to 2 lane road transition, that doesn't look right. Unless perhaps additional line markers are used through, for example, side objects. I will however check what causes these visual issues. First thoughts are that this could be be related to the connection length and considerable width change.

    Thanks,
    Raoul
     
  4. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Hey again @raoul

    Well in my case I will need to go from 6 to 4 to 2 Lanes and I am using different road types for each. So how would I best do this if not through i-connectors?

    Thomas
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Dynamic built-in realistic lane changes are complex. In v3.2 custom built-in road shapes will be supported. There are more options available to define the road profile as shown in the initial v3.2 introduction video at the start, http://unityterraintools.com/v3beta.php . With motorway support coming up there will be more options to define the road profile. This will also make built-in lane changes possible in future releases.

    I realize this does not help you if you need this now. You are an artist, you probably know what is involved in this. If you have a suggestion for a simple implementation that will be able to do this we will be happy to look into that.

    Meanwhile, what is possible is model these transitions and import them through the same Custom Prefab system I mentioned yesterday. That is what other users currently do. For example, unitypolska2000, who had questions about this on the previous page, one of the models he sent was a complex T crossing including lane changes.

    Thanks,
    Raoul
     
  6. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Hello, I want a crossing dirt road. But when I change road preset, it appeared as pink. Why those options are grey?
     

    Attached Files:

  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hello unity_c1ndWE1Nn46iPg,

    Which crossing prefab is this?

    The assigned road type is "Dirt path Sand". It is indeed recommended to assign road types to crossing connections. And in that case the other options are greyed out like in your screenshots because the road type settings will be used.

    In the road type settings there is a "Connection Material" slot just below the "Road Material" slot. This is the material that will be assigned to connection prefabs when this road type is used. Is a material assigned?

    Thanks,
    Raoul
     
    Last edited: Jul 1, 2019
    unity_c1ndWE1Nn46iPg likes this.
  8. PhilipZ0

    PhilipZ0

    Joined:
    Mar 5, 2019
    Posts:
    16
    Hey,

    after downloading Easy Roads Pro and Easy Pro Addon, I have problem with adding SideObjects in the scene. When I open Side Object Manager and select import Side Object, the error message pops up "This prefab does not have valid Side Object Data." The Add Project Side Objects is not enabled all the time, probably some problem with reading the prefabs.

    I have read the known issues and changed the Editor settings to MixedMode for Asset Serialization.

    And it would be interesting to have a small script or idea to generate via runtime the SideObjects as well. Since I am generating road segments on the fly it would be useful to add side objects and background forest as well. Do you have some approach for that?

    p.s I have also the same issue with Road types, at Road Settings the Add Project Road Types is disabled and I only have default road even though I have imported the Pro and Addon package. I am also looking for a way to have 3-lane road. I didn't find road type in the Easy Roads Addon I bought because of that.

    Thanks, Philip.
     
    Last edited: Jul 1, 2019
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Philip,

    Just to be sure, does this message indeed appear after dropping the "HD Roads Presets" prefab in the import window?

    I don't think this is related to Asset Serialization settings. Possible previous Text mode Asset Serialization issues should be resolved anyway in recent Unity versions.

    It seems perhaps something went wrong with the package import. Or are there any error messages?

    This particular message will be displayed when the prefab does not have the ERSideObjectLog component attached. Could you double check if this component is indeed available?

    The same applies to importing road types from the HD Roads package. Or did that work well?

    Up until the current asset store version 3.1.7.1 it was recommended to work with a road network already available in the scene. When activating side objects for road types they will be generated automatically. Last Friday v3.1.8 was released on our website, today we will upload the asset store version. v3.1.8 includes the first steps for full side object control through the scripting API. https://www.unityterraintools.com/releaseNotes.php

    Thanks,
    Raoul
     
    40detectives likes this.
  10. PhilipZ0

    PhilipZ0

    Joined:
    Mar 5, 2019
    Posts:
    16
    I don't have any errors or messages when importing packages, but I get the message above "This prefab does not have valid Side Object Data." When I want to drag n drop side object prefab to Import Side Object.

    After I have imported for example HD Roads Addon I have only these elements, there is no HD Roads prefab, only sideObject prefabs and materials/textures. The screenshot is in the attachment.


    I did now download the Demo Project and opened in the new Unity project the demo scene. After starting the scene I get the message "Default clip could not be found in attached animations list." and nothing is happening. Is this maybe problem because it is the legacy animation since I am using 2019.2.0b1 or I am just using it in the wrong way. I think this demo project is made impressive with all the interesting points to learn about, but I can't access them. Thank you for fast responses. Cheers
     

    Attached Files:

    • img.PNG
      img.PNG
      File size:
      5.5 KB
      Views:
      61
    Last edited: Jul 1, 2019
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Philip,

    Which prefab did you drop in the Road Types and Side Objects Import windows?

    The attached image shows the folder: Assets > EasyRoads3D_HD_Add_ON

    What exactly is this folder? Which packages do you have imported? It looks similar to the folder structure of the free Windridge City package on the asset store. That scene was made with EasyRoads3D Pro and HD Roads assets but it doesn't include the full package, it is free.

    Thanks,
    Raoul
     
  12. PhilipZ0

    PhilipZ0

    Joined:
    Mar 5, 2019
    Posts:
    16
    I have imported EasyRoads Pro, EasyRoads Pro Addon and I was trying to drop in SideObjects from Easy Roads Addon to the Side Objects Import windows (for example curb) and I got the message above.
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Philip,

    Assets > EasyRoads3D_HD_Add_ON

    This is not the default path of the HD Roads package and the contents of this folder in your screenshot does not match the actual HD Roads contents.

    https://assetstore.unity.com/packag.../roads/easyroads3d-pro-add-on-hd-roads-118774

    Please check the package preview in the Package Contents section. It does not match your screenshot. Either something went wrong or you have a different package imported, Windridge City?

    Can you provide exact steps of what you did here?

    Both the manual and the second video on the asset store page shows the steps I mentioned in my first post.

    It seems a source model, curb, was dropped in the import window. The import window is intended for importing existing side object presets from, for example, another project, or in this case the HD Roads package. What you can do is create a new side object in the Side Object Manager and drop the curb prefab in the "Source Object" slot. This will create a new side object based on the curb model. But is still unclear if you actually have the full HD Roads package imported, because in that case there is no need to recreate side objects. Just follow the manual (just one or two pages) and / or the video tutorial.

    Thanks,
    Raoul
     
    Last edited: Jul 1, 2019
  14. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Hey again @raoul

    How would I best go about doing on/off ramps to Highways for instance? (see image).

    2019-07-01_11h57_30.jpg
     
  15. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Solved!
    Now other problem when i create my own fences it always face to the wrong direction and is not connected. No matter how I try to adjust the setting it's just getting worse
     

    Attached Files:

  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi unity_c1ndWE1Nn46iPg,

    Glad to hear that!

    Regarding the side object problem, EasyRoads3D expects the models assigned as the source object to face in the Z direction, just like how they will be spawned along the spline shape. So it is good practice to model the objects that way.

    A quick fix for existing models is to create a new prefab, add your model as a child prefab and rotate it 90 degrees on the Y-axis.

    Thanks,
    Raoul
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Thomas,

    This too is something that can only be done through the Custom Prefab system based on your own models in the current public v3.1

    To some extend it can be done using the Flex Connector in the current v3.2 beta, but that will look more like Y crossings.

    True on/off ramps are currently being worked on. It will also be part of the final v3.2

    EasyRoads3D-motorway-exit.jpg

    Thanks,
    Raoul
     
    Willbkool_FPCS and hopeful like this.
  18. unity_c1ndWE1Nn46iPg

    unity_c1ndWE1Nn46iPg

    Joined:
    Jan 13, 2019
    Posts:
    148
    Hey, how can I achieve this?
     

    Attached Files:

  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi,

    When the first or last marker is selected there is a Fade In resp. Fade Out slider near the bottom in the markers settings, this will set the fade distance.

    Additionally to that a shader is required that will actually do the fading by looking at the vertex color alpha value. For example the ER Road Transparency shader can be used for this.

    Thanks,
    Raoul
     
    unity_c1ndWE1Nn46iPg likes this.
  20. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153

    I'm using the beta version, is there anyway to have a quickfix for this?
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi marcrem,

    This is updated in v3.1.8 available on our website and pending approval on the asset store.

    I will prepare a new 3.2 beta as well.

    Previously I wrote that currently a fixed radius is used. That is not correct. A fixed number of cells is used, 50 cells wide and deep. In the update, the grid size can be set.

    Thanks,
    Raoul
     
  22. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    439
    Hi Raoul. I been using this since the very early days of it.. and I see more and more people, complaining how hard it is to use for new users. ( I can understand it.. but if they take the time as I tell everyone else to learn it and carefully look at the demo's they will understand it. ( I find it to be super powerful and the best tool on the store personally.. but.. I was wondering, if you thought of making a Discord. This can help users help one another and take some slack off of you even. This helps with many assets, games and even software. We use this for Modo, Maya, and many artist channels and many other assets as well. Just a thought..:) I know many new users get annoyed and use something else. due to not understanding. so I hate that people do this and I think if they had community help hands on with something like Discord this could help you and them.

    This has shown to do so for many other tools. Something to think about..


    PS: I rarely come to Unity forums anymore, I spend my days on Discord helping new developers. with many other things and making our new game. in Unreal and Unity.

    I hope you consider this. I think you will find it will help them and you. (as I know the POWER of this tool. and I think many people are missing out.
    Keep up the great work.. !
     
    sharkapps and StaggartCreations like this.
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Recon03,

    How are you?

    The tool is complex with many options. Depending on how you want to use it or if you want to get the most out of it, there is a learning curve involved. The situation is that regarding tutorials we are constantly evaluating what to do given that 3.2 will be a mayor update and wanting to avoid spending time on video tutorials that will be outdated to some extend when 3.2 is out.

    We also look at what people ask for through the survey on our website (I added Discord to it). People generally ask for more features, that is what we are focused on.

    New tutorials will follow when v3.2 is out, but additionally to the manual (Quick Start), and the tutorials on our website including the free demo package, I will put some time in a new video tutorial covering the basics how to use the tool if that will help new users. If there is anything specific new users have a problem with, please let us know so we can address it in the tutorial and otherwise or improve the tool if that is necessary.

    And if users do like to see a Discord channel, let us know, we will look into it anyway.

    To anyone, we are available for support anyway, here or by email. Please ask if you have questions.

    Thank you :)

    Raoul
     
    Last edited: Jul 11, 2019
    dav-id likes this.
  24. stepkka

    stepkka

    Joined:
    Apr 5, 2017
    Posts:
    1
    LWRP road shaders produce a compilation error
    Unity 2019.1.3f1, EasyRoads 3 Pro + HD Roads 1.1 easyroads.png
    When I comment out these variable declarations, everything seems to work all right
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi stepkka,

    The package with LW HD RP shaders indeed need to be updated on the asset store. I will test the versions we have on Unity 2019.1.3f1 and the latest LW HD version before uploading. You already got it sorted out, but if you want I can send the LW RP package that did work on recent LWRP versions.

    Thanks ,
    Raoul
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    v3.1.8 is now available on the asset store

    Joining roads can now also be done directly in the Scene View window by snapping road markers
    1. Doing this on a single road will close the road
    2. Two roads with the same road type will merge in one road object
    3. An I Connector will be inserted when different road types are involved
    Side objects can now also be added through the scripting API

    For more 3.1.8. info please visitthttps://www.unityterraintools.com/releaseNotes.php

    As always, please backup your project before upgrading

    Thanks,
    Raoul
     
    Rowlan likes this.
  27. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153
    Awesome!! Will you post here when the new 3.2 beta is available? Thanks so much
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Yes I will post here, but which version of Unity do you use? I will prepare that build first and send it to you so you can test it.

    Thanks,
    Raoul
     
  29. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153
    2018.2.12f1 is our version currently. might upgrade to 2018.3 if really needed.
     
  30. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153
    Last edited: Jul 6, 2019
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi marcrem,

    I just send you a message with a v3.2 build for 2018.2.12f1

    No connections will be created when roads are close when the mouse button is not released, you can try that. He must have dropped the marker on the other road section, this will trigger the road snapping feature and insert a crossing. The situation here is that the HD Roads package is used. It includes many different crossing prefabs and many different road types. They all work together, so there for no exact selection can be made and a prefab will be selected randomly. This road snapping feature is not ideal for the HD Roads package. I think he didn't intend to snap the roads but if he would want to, then in the case of the HD Roads package it is better to line the two roads up and insert the desired connection prefab through the connection tab, split the other roads and attach both ends.

    In the second video he moves the mouse away with the marker still selected. For sure the marker will not move to the other road and snap all by itself.

    Have you ever seen that happen?

    Thanks,
    Raoul
     
    Last edited: Jul 6, 2019
  32. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153

    The two videos are from my level designer partner working on our roads.
    The connections are appearing absolutely randomly. He can be zooming out, panning the camera around, etc, then this happens and it's a pain to reverse it. I'll have him read your answer anyway and see if it rings a bell.
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Ok, he is your level designer! Do you mean this marker snapping happens more often? I have never seen roads snapping what seems to be out of nowhere and this is the first time this is reported. So at this moment I cannot really give more feedback. There is no pattern? A keypress combination or mouse button action after a marker is selected or moved? Or when moving over another road section while a marker is selected?

    From a coding point of view, snapping roads and auto inserting a crossing involves tracking marker position changes using Unity's Handles.PositionHandle(). Snapping a marker to another road section requires releasing the mouse button. Only these two operations should result in roads snapping together.

    If this is indeed related to snapping markers and auto inserting crossing then Undo should remove the crossing. Because a serie of processes is involved and also possible user actions afterwards, multiple Undo's may be required. I just checked, straight after the snapping two or three undo's may be required in a standard situation.

    The video is long, is there anything else in the video you have questions about? I will check it anyway.

    Thanks,
    Raoul
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    @marcrem,

    I watched the first hour of the video, it is interesting to see how the tool is being used. Here is some feedback:

    0:15:07 markers are being removed to make the road straight. This can be time consuming. In the video a couple of minutes are spend on this. A quick way to make a road section with multiple markers more straight is select the first and the last marker (Shift + Z) of the straight section. This will show alignment options in the Inspector. Afterwards the position of some markers can be adjusted to make it less straight

    This will also work for the situation around 0:25:00, creating two parallel straight roads for which he wanted to use the grids option. These markers can be aligned much quicker using the alignment options (all together 10 secs or so). In any case, around 00:30:10, grids can be rotated in a certain direction, in this case following the interstate if that is what you wanted here. That is where the local grid option is useful

    Saving can take long for some reason in Unity versions up to 2018.2, Unity also reimporting assets some times. This is not the case in Unity 2018.3 and newer

    00:32:00 shows I belief the issue you mentioned with grids and the editor lagging. Is that improved in the update I sent? Otherwise, it seems for the first markers this worked well. Just as a test to see what may cause this and isolate the problem, does this approve after deactivating and reactivating the grid again?

    00:35:00 this shows something similar as in your posts, a prefab being inserted. This time however, it looks like the marker was dropped on the road. Then the prefab was deleted. As mentioned in my previous post, please try Undo instead! In any case, then there was an attempt to snap markers to the other road which will not work in the version he is using. This is introduced in v3.1.8 and should also work in the update I sent yesterday. In the current build however he could select the markers of both roads and press the "Join Selected Roads" button in the Inspector or Shift + J. There is no need to delete a road and rebuild it.

    00:53:45 It is "Duplicate Object" what he is looking for ...and that is what he did at 56:02 :)

    Starting from 00:57:00 a couple of things:

    1) What exactly happens at 00:57:00. It seems like an object in the hierarchy is selected instead of the marker?

    Then at 00:57:30 it appears he did Shift + drag instead of simply dragging the marker. Because a new marker is dragged straight from the selected marker (two markers very near to each other). Shift + Drag means a new marker is pulled out from the selected marker instead of moving the selected marker. This is an easy way to create bridge sections where the new marker will be aligned in the direction of the road at the bridge height instead of snapping to the terrain like the standard Shift + Click when adding markers. But Shift + Drag is not what you want here.

    00:58:45 This is not really a standard situation for an I Connector. The two road sections can simply be merged in one object like mentioned above, select both markers holding the Shift key and press the "Join Selected Roads" button in the Inspector or Shift + J. Or, in the latest versions simply snap the markers together.

    00:59:00 were there any error messages at that moment in the console? By default when clicking an object in Unity that object is selected. With EasyRoads3D that is not what you want, clicking a marker means the object below that marker will be selected, instead the road network object should remain selected. So this event is intercepted except for double click events. For some reason the interception does not work at this stage in the video and the other object is selected. I am pretty certain it is not a double click that is causing this at this moment, but errors could cause that as well.

    Thanks,
    Raoul
     
    hopeful likes this.
  35. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153
    First of all, huge thanks for taking that much of your time to help us. Here's the LD's answer:

    00:35:00 : I tried ctrl+z a few times when this happened before deciding to remove the prefab. Undoing does not always do a clean job in those weird cases.

    00:57:00 : Yeah it wouldn't want to stop selecting Landscape Builder instead of the node. Restarting Unity fixed this

    00:59:00 : I don't remember the error at that point, but this was another weird issue I could not understand, restarting unity fixed all those weird issues.

    About the grid performance, drawing a way smaller grid in the new version worked :)
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi marcrem,

    No problem, as mentioned it is good to see how the tool is being used.

    Does it do a clean job in other situations? Is there more feedback on the users actions when that happens?

    But the Landscape Builder object is a Unity Terrain object or not? Otherwise that would explain the road network gets deselected. Some additional code should be added for Lanscape Builder objects.

    Could you check for errors when this happens again and let me know, that would be much appreciated.

    Glad to hear the Grid optimization in the latest version does work well.

    Thanks,
    Raoul
     
  37. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    153
    His answer:
    "ctrl+z works great usually, I use it a lot when I need to undo small mistakes when working too fast."

    Landscape builder uses a gameobject with the landscape builder scripts, and the associated terrains are children of this object. It also uses an editor window that controls everything on that main object, so maybe making sure that the LB window is closed while working on roads would fix it. I'll investigate.

    We'll make sure to send the errors if we get any.

    Thanks!
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Ok, thank you!

    Regarding Landscape Builder, as long as the terrain that is clicked has a Unity Terrain component attached, this object should be handled correctly as a terrain object regarding Scene View window behaviour. I do belief that is the case with Landscape Builder that is why I asked.

    Thanks,
    Raoul
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    v3.2 beta 6 is now available on our website

    https://www.unityterraintools.com/download.php

    It includes the v3.1.8 updates which was released last week.

    Additionally there are more options for generating lane data in General Settings > AI Traffic. And lane data can now also be created for left-hand traffic. The example AI script is updated as well. Beta notes

    As always, please backup your project before upgrading.

    Thanks,
    Raoul
     
    dav-id and marcrem like this.
  40. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Hi there @raoul

    So currently the standard sidewalks have 90 hard edges. How do I go about giving it a Bevel? What are the steps involved?

    2019-07-09_11h49_08.jpg screen_shot_2019-07-09_at_8.20.50_am.png
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi Thomas,

    Currently this can be done in the connection settings by selecting the prefab in the hierarchy or, ideally, for the source prefab in:

    /Assets/EasyRoads3D/Resources/dynamic prefabs/

    The sidewalk options are located in "Corner Settings" foldout





    Make sure "Uniform Corners" at the top is checked if you want to change the sidewalk on all corners.

    Check "Beveled Curb"

    Adjust the Bevel Height and Width values

    After changing this you want to press the "Sidewalk UV Editor" button to fine tune the UVs.

    sidewalkUVs.jpg

    After the UV Editor window opens, press Z to put focus on the texture of the sidewalk material (if necessary)

    The canvas can be dragged to position the texture, the scrollwheel or Right Click + Drag can be used to zoom in /out

    At the bottom you will see the black dots representing the nodes. Press and drag a node to position it. The sidewalk in the scene / prefab editor will update accordingly.

    Ideally you want to do this before building the road network. But if there are already instances in the scene then, with the prefab selected in the project folder, have a look in the Inspector and press "Refresh Scene Instances" in the "ER Crossing Prefabs" component.

    In v3.2 sidewalks will have its own section in General Settings where this can be setup.

    Thanks,
    Raoul
     
    Thomas-Pasieka likes this.
  42. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Thanks @raoul ! Well looks like I have to redo the whole road network as I can't simply swap them out with the new Crossing/Sidewalk setup. I hope this will be easier in 3.2?
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    In v3.2 sidewalks will no longer be part of the crossing settings so updating sidewalks will indeed work different.

    But in what way can the road network not be updated? Does the "Refresh Scene Instances" option not work? Or are different crossings involved? In that case the sidewalks on all crossings can be updated. The easiest way to do that is to store the new sidewalk settings as a preset . "Refresh Scene Instances" one by one per crossing prefab type may initially not work well when a road is connected with two different crossing prefab types. But that should be resolved after "General Settings > Scene Settings > Refresh Road Network" once all prefabs have been updated using "Refresh Scene Instances".

    The only thing that may need to be redone is manually activated / deactivated sidewalks not matching the original crossing prefab because the prefabs are updated according the prefab in the project folder. That is why it is currently better to first set the sidewalks. But if sidewalks are always active on both sides this should not be a problem.

    Thanks,
    Raoul
     
  44. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,112
    Well if I create a new Crossing with new Sidewalk options under a new name then I don't see how I can replace the old with the new.
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Creating a new crossing with new sidewalks will indeed not work for updating the sidewalks for crossings already in the scene.

    How did you add the crossings to the scene? The way to do that is either by selecting the prefab in the Inspector from the toolbar, the third tab from the left, the crossing connections tab, and Shift + Click in the scene. Or by moving a road over another road, releasing the mouse will insert a crossing prefab and connect the two road objects.

    In both cases this will be an instance from the same "source prefab" in the project folder:

    /Assets/EasyRoads3D/Resources/dynamic prefabs/

    Although individual instances can be customized, from X to T Crossing for example, all instances will share the same ID as the source prefab in the project folder. This makes it possible to update them all after changes to the source prefab in the project folder.

    In Unity 2018.3+ the sidewalks of this "source prefab" can be edited in the new prefab editor window like I mentioned in my previous post. In older Unity versions this prefab can be dropped in the scene. It will be added as a child under "Temp Crossing Prefabs". That way it can be edited in a similar way. After saving the updates it will be removed from the scene.

    At that point, with this source prefab selected in the project folder, the scene instances can be updated by pressing "Refresh Scene Instances" in the "ER Crossing Prefabs" component in the Inspector.

    Thanks,
    Raoul
     
    Thomas-Pasieka likes this.
  46. nmbileg

    nmbileg

    Joined:
    Sep 29, 2017
    Posts:
    11
    Hello, Raoul! My road is completely created by random marker points on runtime (no crossings), and I'd like to know if I could make road have sharp turns just like in the picture below. Current one automatically generates curved road after given marker points.
     

    Attached Files:

  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,630
    Hi nmbileg,

    Inside the Unity editor please have a look at the "Circular" controller type, "Control Type"near the top in the marker settings in the Inspector and get a feel of how this works.

    In the below image the selected marker is the second marker where the turn starts, the control type is set to "Circular"

    EasyRoads3D-Turn.jpg

    Then to do this at runtime through the scripting API :

    ERRoad.SetMarkerControlType(int markerIndex, ERMarkerControlType type)

    ERMarkerControlType options are: Spline, StraightXZ, StraightXZY, Circular

    Thanks,
    Raoul
     
  48. nmbileg

    nmbileg

    Joined:
    Sep 29, 2017
    Posts:
    11
    VERY VERY VERY MUCH APPRECIATED!
    Very good support thanks!
     
    raoul and hopeful like this.
  49. 40detectives

    40detectives

    Joined:
    Apr 9, 2016
    Posts:
    74
    I'm trying to do an endless straight road from some road segments that are moved at runtime.
    I have a Road Network with a few roads of the same type. When I hit a collider at the beggining of the next road, I understand that the previous road can be relocated and use:

    thisRoad.SetMarkerPositions(markers);  //markers is the new array with the new positions


    That seems to work, the road is moved, its sideobjects are placed at the new positions etc. etc. But this error is displayed in the console after the previous line is executed:
    ERROR_DestroyImmediate.png
    (TerrainCollisionPropagator.cs is the script that propagates the OnTrigger event so EndlessRoad.cs can execute the SetMarkerPositions when is necessary. )
    I've confirmed that this error pops up once for each "side object node" in that road, in this case I have two sideobjects in that road segment and therefore two errors.

    Is there a way of avoiding this? I've tried using:
    thisRoad.SideObjectMarkerSetActive(roadNetwork.GetSideObjectByName("My Side Object"), index, false);


    But that only made the sideobjects in the new positions disappear, and the ones in the old positions remained. The error still poped up in the console.
     
  50. 40detectives

    40detectives

    Joined:
    Apr 9, 2016
    Posts:
    74
    As the problem is that the sideobject is being destroyed while on a physic trigger/contact event, for the time being I've defferred the SetMarkerPositions() call by using an Invoke 0.1s after the collider was hit. That seems to work.

    A couroutine with
    yield WaitForSeconds(timer);
    may work too.