Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

EasyRoads3D v2 is out – Road, rivers, procedural geometry for Unity

Discussion in 'Assets and Asset Store' started by raoul, Mar 18, 2011.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    You can use Shift+Z to select all markers, changing the indent values on an existing road will affect all markers.

    EasyRoads3D does work on a mesh terrain, General Settings > Scene Settings > Mesh Terrain. But the terrain deformation feature is indeed Unity terrain object specific, it will not work on a mesh.

    You are already using v3, I was only pointing to the v3 forum thread, this is the older v2 thread :)

    Thanks,
    Raoul
     
  2. Deleted User

    Deleted User

    Guest

    Ok, thx for all, im actually looking at tuts and demo scene, but there alot to learn here. I will post on the other topic in the futur
     
    raoul likes this.
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    The toolset is comprehensive with many different options and features. Let us know if you have any further questions.

    Thanks,
    Raoul
     
  4. Chumbledorf

    Chumbledorf

    Joined:
    Jul 22, 2018
    Posts:
    1
    Did you ever implement these cul-de-sacs? I cannot find another reference to them besides this post.
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hello,

    I flipped a couple of pages back but I cannot find this post.

    Apart from our own schedule, we currently follow what is rated highest on http://unityterraintools.com/survey.php

    We did start on cul-de-sac specific code and have a prototype, most requests regarding connection prefabs are however for Y crossings and motorway exits, that is what is being worked on for v3.2. Meanwhile cul-de-sacs can be added through the custom prefab system as imported mesh models. Built-in support for cul-de-sac will follow afterwards.

    The current V3 thread:
    https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  6. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    I'm failing to get the HD Addon to work. I'm using HD RP 7.3.1 in Unity 2019.3.13f1. I've imported Easy Roads Pro v3.1.9.f4 and also Easy Roads3D Pro Add On - HD v1.2.3. I've followed the HD instructions and removed 2 shaders and selected the EasyRoads Addon - HD SRP 7.2.1+ support pack. When I open the demo scene I can see the roads, so that's a good start. However, when I select the Road Manager I get a lot of errors.
    An EasyReoads3Dv3 Error dialog pops up; Empty markers found - do NOT save the scene...[Report]
    When I select the Road Network again I get;

    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>: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 <437ba245d8404784b9fbab9b439ac908>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.HostView.Invoke (System.String methodName) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.DockArea.OldOnGUI () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)


    When I try to import side parts I get;


    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.HostView.Invoke (System.String methodName) (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEditor.HostView.OldOnGUI () (at <480b5a3bd3214ce5831f6dd8c68fdc55>:0)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.OpenGate () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <95b42489e2e04430a87c3760aa29fca2>:0)
    UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi donkey0t,

    I just had a look at the additional HD RP package for HD RP v7.3.1. Something is indeed wrong with the demo scene for that package. I will check that. Does the package work well in your own scenes?

    To get the current demo scene working in HD RP v7.3.1 you can:
    1. Duplicate this scene.
    2. Import the demo scene again from the main HD Roads package. Two demo scenes should be available now.
    3. Open the duplicated HD RP demo scene and remove the road network object
    4. Add the main demo scene to the hierarchy as well
    5. Drag the road network from this scene to the HD RP scene
    6. Remove the main scene so only the HD RP scene remains in the hierarchy

    EasyRoads3D v3 thread:
    https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  8. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Thanks for the reply. That workarounds is good enough to get me going, although all the icons for the Roads Network (manager) UI have vanished :s But I just click around until I find the correct tab but I thought I'd let you know.
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Are the toolbar icons missing in your own scenes or in this specific HD RP demo scene?

    If this is in general then it seems there was an issue with the EasyRoads3D Pro package import. The icons are located in /Assets/EasyRoads3D/textures/editor/

    Thanks,
    Raoul
     
  10. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    After the workaround for that scene, they've all gone for that scene.
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    So the textures are available in the project folder and they are visible on the toolbar in your own scenes. The problem is specifically with the HD RP v7.3.1 demo scene. This will be looked into.

    Thanks,
    Raoul
     
  12. minad2017

    minad2017

    Joined:
    Dec 1, 2016
    Posts:
    50
    I have a question about Ident.
    In a previous post, Easy Roads Indent understood that Terrain settings create a minimum setting.
    I've tried it on various terrains, but the Ident value doesn't drop from 2.92968
    I want to make a very narrow path for humans to walk
    Is it possible to make it lower than 2.92968?

    Unity Ver2019.3.14
    EasyRoads Ver3.1.9.f4
     

    Attached Files:

  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi minad2017,

    These Indent values represent the distance over which the terrain will be levelled at the same height as the road at that position. It is indeed locked to a minimum value which is based on the terrain specificactions, terrain size and terrain heightmap resolution. If that would not been done and the Indent value would be lower then the terrain will break through the road in areas where the original terrain is higher or it will float above the terrain in areas where the terrain is lower.

    So in order to make it narrower the heightmap resolution can be increased.

    Another way is to use terrain mesh overlays, this can be done manually but also auto generated in v3.2 which is almost ready for release, https://forum.unity.com/threads/eas...-new-road-system.229327/page-167#post-5901377 . Please use the v3 thread anyway for posting questions, this is the older v2 thread :)

    But you mention walk paths, how wide is the path? Is it in this case perhaps easier to bake the road shape in the terrain and hide the generated "road" mesh?

    Thanks,
    Raoul
     
  14. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    I am having some disagreements with ER3D and the floating point. I can't move the road network with the rest of the scene transforms when I run the floating point scripts. Even removing the scripts. Have do you watched any of this? Do you have any procedure to move the road network in the floating point stuff?
    Thanks and regards,
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721

    Hi joanpescador,

    Could you give more details what you want to do?

    In general, the road network position is locked to (0,0,0). The reason for that is to avoid accidental road network position changes and new roads being add or roads being changed . It will be a pain to move it back to the original position, if that position was not (0,0,0) and match the roads exactly with the terrain.

    But it is possible to move the road network by moving the two child objects "Connection Objects" and "Road Objects". There will be a notification in the Inspector with a button to confirm the position change.

    Thanks,
    Raoul

    Ps. This is the old v2 thread, the current v3 thread can be found here: https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/


    .
     
  16. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    I think this is all I need.
    I have large road networks of hundred of kilometres. When I place an onboard camera in a car which is more than 50 kilometers from (0,0,0), everything shakes like pudding due to the problem of the precision of the decimals, of the transforms, the "floating point". You know.
    To solve this, you have to move the whole scene, periodically, by code, to the origin point.
    I'm going to move the two child objects instead of the road Network object. I think it will work.
    Thanks,
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi joanpescador,

    Is this runtime related? The specific behaviour to keep the road network at (0,0,0) should only happen inside the Unity editor and when the road network object is selected.

    Thanks,
    Raoul
     
  18. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    It is in play mode in the editor:

    Code (CSharp):
    1. Object[] objects = FindObjectsOfType(typeof(Transform));
    2.             foreach (Object obj in objects)
    3.             {
    4.                 Transform transform = (Transform)obj;
    5.                 if (transform.parent == null)
    6.                 {
    7.                     transform.position -= cameraPosition;
    8.                 }
    Anyway, moving only the child doesn't work because, in the editor, all child objects are stuck in (0,0,0) too, except the Start/End Decals. :confused:
    Will I be able to move the road network if I finalize the road and remove the ER3D scripts?
    Thanks,
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Yes, that is why this button "Apply Transform Changes" is added to confirm transform changes. All road data will be recalculated based on the new position and afterwards the object is set back to (0,0,0).

    But all this is done and triggered through editor scripts, this should not interfere at runtime.

    Yes, finalizing the road network by itself will already remove all editor scripts. But it is recommended to only do that at the end just before final platform builds. And even then you probably also want to backup the road network / scene first, just in case you like to make changes at a later stage.

    Thanks,
    Raoul
     
  20. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Sorry Raoul, where is this "Apply Transform Changes" button? I never seen before.
    Anyway, I really need to get around this blockage. What do you recommend? I really needs to move the road network, otherwhise, the all project is unavailable.
    I have a duplicate project with all ER3D scripts removed but even there road meshes keep stuck in same position even when "Road Objects" and "Connection Objects" shows a different position in transform.

    Code (CSharp):
    1. // FloatingOrigin.cs
    2. // Written by Peter Stirling
    3. // 11 November 2010
    4. // Uploaded to Unify Community Wiki on 11 November 2010
    5. // Updated to Unity 5.x particle system by Tony Lovell 14 January, 2016
    6. // fix to ensure ALL particles get moved by Tony Lovell 8 September, 2016
    7. // URL: http://wiki.unity3d.com/index.php/Floating_Origin
    8. using UnityEngine;
    9. using System.Collections;
    10.  
    11. [RequireComponent(typeof(Camera))]
    12. public class FloatingOrigin : MonoBehaviour
    13. {
    14.     public float threshold = 100.0f;
    15.     public float physicsThreshold = 1000.0f; // Set to zero to disable
    16.  
    17. #if OLD_PHYSICS
    18.     public float defaultSleepVelocity = 0.14f;
    19.     public float defaultAngularVelocity = 0.14f;
    20. #else
    21.     public float defaultSleepThreshold = 0.14f;
    22. #endif
    23.  
    24.     ParticleSystem.Particle[] parts = null;
    25.  
    26.     void LateUpdate()
    27.     {
    28.         Vector3 cameraPosition = gameObject.transform.position;
    29.         cameraPosition.y = 0f;
    30.         if (cameraPosition.magnitude > threshold)
    31.         {
    32.             Object[] objects = FindObjectsOfType(typeof(Transform));
    33.             foreach (Object o in objects)
    34.             {
    35.                 Transform t = (Transform)o;
    36.                 if (t.parent == null)
    37.                 {
    38.                     Debug.Log(t.gameObject.name);
    39.                     t.position -= cameraPosition;
    40.                 }
    41.             }
    42.  
    43.             //Object[] objects = FindObjectsOfType(typeof(Transform));
    44.             //foreach (Object obj in objects)
    45.             //{
    46.             //    Transform transform = (Transform)obj;
    47.             //    if (transform.gameObject.name == "RoadShakeDown")
    48.             //    {
    49.             //        foreach (Transform child in transform)
    50.             //        {
    51.             //            Debug.Log(child.gameObject.name);
    52.             //            child.position -= cameraPosition;
    53.             //        }
    54.             //    }
    55.             //    if (transform.gameObject.name == "Cars" || transform.gameObject.name == "MonteTestStage" || transform.gameObject.name == "Towns" || transform.gameObject.name == "Enviroment" || transform.gameObject.name == "Conifer_Desktop")
    56.             //    {
    57.             //        transform.position -= cameraPosition;
    58.             //    }
    59.             //}
    60.  
    61. #if SUPPORT_OLD_PARTICLE_SYSTEM
    62.             // move active particles from old Unity particle system that are active in world space
    63.             objects = FindObjectsOfType(typeof(ParticleEmitter));
    64.             foreach (Object o in objects)
    65.             {
    66.                 ParticleEmitter pe = (ParticleEmitter)o;
    67.                 // if the particle is not in world space, the logic above should have moved them already
    68.         if (!pe.useWorldSpace)
    69.             continue;
    70.                 Particle[] emitterParticles = pe.particles;
    71.                 for(int i = 0; i < emitterParticles.Length; ++i)
    72.                 {
    73.                     emitterParticles[i].position -= cameraPosition;
    74.                 }
    75.                 pe.particles = emitterParticles;
    76.             }
    77. #endif
    78.  
    79.             // new particles... very similar to old version above
    80.             objects = FindObjectsOfType(typeof(ParticleSystem));
    81.             foreach (UnityEngine.Object o in objects)
    82.             {
    83.                 ParticleSystem sys = (ParticleSystem)o;
    84.  
    85.                 if (sys.simulationSpace != ParticleSystemSimulationSpace.World)
    86.                     continue;
    87.  
    88.                 int particlesNeeded = sys.maxParticles;
    89.  
    90.                 if (particlesNeeded <= 0)
    91.                     continue;
    92.  
    93.                 bool wasPaused = sys.isPaused;
    94.                 bool wasPlaying = sys.isPlaying;
    95.  
    96.                 if (!wasPaused)
    97.                     sys.Pause();
    98.  
    99.                 // ensure a sufficiently large array in which to store the particles
    100.                 if (parts == null || parts.Length < particlesNeeded)
    101.                 {
    102.                     parts = new ParticleSystem.Particle[particlesNeeded];
    103.                 }
    104.  
    105.                 // now get the particles
    106.                 int num = sys.GetParticles(parts);
    107.  
    108.                 for (int i = 0; i < num; i++)
    109.                 {
    110.                     parts[i].position -= cameraPosition;
    111.                 }
    112.  
    113.                 sys.SetParticles(parts, num);
    114.  
    115.                 if (wasPlaying)
    116.                     sys.Play();
    117.             }
    118.  
    119.             if (physicsThreshold > 0f)
    120.             {
    121.                 float physicsThreshold2 = physicsThreshold * physicsThreshold; // simplify check on threshold
    122.                 objects = FindObjectsOfType(typeof(Rigidbody));
    123.                 foreach (UnityEngine.Object o in objects)
    124.                 {
    125.                     Rigidbody r = (Rigidbody)o;
    126.                     if (r.gameObject.transform.position.sqrMagnitude > physicsThreshold2)
    127.                     {
    128. #if OLD_PHYSICS
    129.                         r.sleepAngularVelocity = float.MaxValue;
    130.                         r.sleepVelocity = float.MaxValue;
    131. #else
    132.                         r.sleepThreshold = float.MaxValue;
    133. #endif
    134.                     }
    135.                     else
    136.                     {
    137. #if OLD_PHYSICS
    138.                         r.sleepAngularVelocity = defaultSleepVelocity;
    139.                         r.sleepVelocity = defaultAngularVelocity;
    140. #else
    141.                         r.sleepThreshold = defaultSleepThreshold;
    142. #endif
    143.                     }
    144.                 }
    145.             }
    146.         }
    147.     }
    148. }
    149.  
    http://wiki.unity3d.com/index.php/Floating_Origin
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721

    Hi joanpescador,

    Regarding "Apply Transform Changes", I mentioned this button in my reply to your first post above. This button appears after moving "Connection Objects" and "Road Objects".

    We have discussed a couple of things. Could you give feedback on that? Below is a summary.

    You mentioned that this is runtime related and I mentioned that this (0,0,0) situation is Unity editor related and especially when the road network object is selected in the hierarchy. The road network should not be repositioned at runtime.

    I also confirmed that this lock with not happen at all after the "Finalize" option. Have you tried that?

    Thanks,
    Raoul
     
  22. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hia Raoul.
    Thanks for your interest.

    I tried after finalize option and it works.
    I have also managed to move "road object" and "connection object" in runtime. As you say, I cannot modify from hierarchy but it serves me this way too.
    Thanks,
     
    raoul likes this.
  23. zzz999

    zzz999

    Joined:
    Jan 21, 2022
    Posts:
    2
    Hi guys, I've got a question.

    When I made build of road, on some places the terrain goes over road like in this screenshot: https://prnt.sc/26jsgib. (I'm using free version of EasyRoads.)

    Thanks for any answers!
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi zzz999,

    The troubleshooting page in the documentation includes a list of possible terrain related issues and how to deal with these issues.

    The image is zoomed, the terrain is not clearly visible but this appears to be a hilly area. Is this the end of a bend? In these situations there will be differences in the road height over small area, the heightmap resolution of the terrain must be high enough to deal with that.

    What is the "Raise" value in the Inspector, this can be used to move the road network a little bit higher above the terrain.

    Another way to deal with this, if this is more z-fighting related, is by increasing the zfighting terrain offset option in the road material. This option is also available for the free version.

    Also in v3.3 built-in custom road shapes are supported. That can also be useful in these situations, roads with thickness. V3.3 is available in betas on our website but only for the Pro version at the moment.

    This is the old v2 forum thread.

    Below is the link to the current v3 EasyRoads3D forum thread :)

    https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  25. zzz999

    zzz999

    Joined:
    Jan 21, 2022
    Posts:
    2
    Rising the Y position of terrain seems that does the trick. Thanks! :)
     
    Last edited: Jan 27, 2022
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    That should work too (lowering the terrain objetc) although we would probably use the specific "Raise" option if necessary.
     
  27. Ceryni_

    Ceryni_

    Joined:
    Apr 20, 2020
    Posts:
    7
    Hi Raoul,
    i'm having some trouble with the terrain deformation in easyroads. I build on all terrains, only selected roads and update heightmap. when im done i use the back to edit mode - no terrain restore option and it works fine but sometimes after a while i notice the terrain returned to its original state . for example ive build the terrain on the street, then edited a nearby fence and it jumped back...
    do you have an idea what i did wrong?
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Ceryni_,

    "Back to Edit Mode - No Terrain Restore" is permanent.

    In what way is this fence edited? And is this a fence generated as fence only, no road object involved (no terrain deformation)?

    What is the next step in that case? I am asking this because terrain objects are only updated when switching to Build Mode. Is that actually when the terrain gets restored, on the next "Build Terrains(s)" and standard "Back to Edit Mode" afterwards?

    Or do you have exact steps we can follow to recreate what happens on your end?

    The current v3 forum thread :) https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  29. magsoftware

    magsoftware

    Joined:
    Feb 7, 2019
    Posts:
    122
    I cannot use EasyRoads3D in UNity version 2022.3.2f1. When I use GameObject->3D->EasyRoads3D -> New Road Network I get the following errors in the console:
    Code (CSharp):

    Code (CSharp):
    1. TypeLoadException: Could not resolve type with token 010000f9 from typeref (expected class 'UnityEditor.Experimental.SceneManagement.PrefabStage' in assembly 'UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
    2. NullReferenceException: Object reference not set to an instance of an object
    3. EasyRoads3Dv3Editor.ODQDCOOOQQ.OnInspectorGUI () (at <dd33561264d24db997cb26a555e2d9b7>:0)
    4. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <ac87b54e58ee4be198261fd5c8030d52>:0)
    5. UnityEditor.InspectorWindow:RedrawFromNative()
    6. NullReferenceException: Object reference not set to an instance of an object
    7. EasyRoads3Dv3Editor.ODQDCOOOQQ.OnInspectorGUI () (at <dd33561264d24db997cb26a555e2d9b7>:0)
    8. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <ac87b54e58ee4be198261fd5c8030d52>:0)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    I tried to reimport EasyRoads from Package Manager, to reimport all assets from Assets -> Reimport All.. I also tried to update easyroads pro and demo. I don't know what is wrong.
    I don't have any errors on console, those errors appear when I try to use GameObject -> 3d Objects -> EasyRoads -> New Road Network.
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi magsoftware,

    The error points to UnityEditor.Experimental.SceneManagement.PrefabStage, it seems that still an EasyRoads3D package is imported for an older version of Unity.

    Have you tried to force a "Re-Download" first in the Package Manager? This will download the package that matches the open Unity version.

    This is the older v2 thread, this is the v3 thread: https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/ :)

    Thanks,
    Raoul
     
  31. magsoftware

    magsoftware

    Joined:
    Feb 7, 2019
    Posts:
    122
    Thank you! I fixed it.
     
    raoul likes this.