Hello,
My name is Hristo Ivanov and I’m writing this post as a general help/guide to using Easy Roads Mesh Gen v0.3.x and to refer to if needed. I get lots of frequently asked similar questions and I decided to make this thread to help new users get started with the tool.
Before I continue any further let me mention that there’s a Instructions.pdf file in the package which also explains some of the basics.
With that out of the way let’s begin with the first one:
I don’t understand how to add the sidewalk on the roads.
One of the more important features of the tool is being able to add border meshes to better blend your road/river/etc. with the environment around it.
This feature is toggled by the Border Mesh option.
Once you switch Border Mesh on you’ll see more options show-up such as Border Shape and Border UVs.
Border Shape serves as a drawing board and controls the number of vertices and the shape of the borders.
It reperesents a vertical cut of the right border (looking forward from the first NavPoint ) and you can right click to add new “Key” and then move that key to the desired position. If you have Update Mode set to Realtime you can see the changes being applied instantly.
Border UVs option determines how the generated borders are unwrapped, or simply put, how the texture on them looks.
What is Update Mode?
When you’re working with the tool you’ll probably need to instantly visualise the changes you make, but once done you’d probably want to reduce the impact of the tool on the performance in the scene view.
This is where Update Mode comes in.
It controls how often the tool updates it’s mesh and vertices.
‘Manual Update’ has little to no impact on the performance since the tool is updated only when you hit ‘Apply Changes’.
‘Vertices Only’ visualises the position of the vertices but still requires to manually apply the changes.
‘Realtime’ is constantly updating the generated Mesh which makes it easier to work with, but it’s good to leave it off when you are done.
EDIT (29.08.2017): As of version 0.5 there is an ‘Automatic’ Option which aims to optimize the scene performance by preventing non-selected roads from being updated. That ultimately leads to big performance boost and smoother user experience.
Does Easy Roads Mesh Gen support terrain morphing?
EDIT (22.7.2020): As of update v0.3.x the tool did not support terrain morphing, meaning it couldn’t modify the underlying terrain to fit the shape of the road. However with the latest release (v2020 +) that feature has been added to aid level designers get the terrain shape close to what they would need, manual tweaks may still be required after that.
You can also “Ground” the points with a given offset. Grounding snaps each point to the underlying collider which makes the road mesh follow roughly the curves of the terrain. Once grounded, the points might need some manual tweaking (for that make sure the Point Control option is set to “Full Manual”).
Converting from v0.2.x to v0.3.x
When updating from an older version you may get complier errors.
This could be due to a change in the script names which failed to update on import.
What I recommend is deleting the scripts associated with the error and re-importing from the asset store.
That way the scripts will be downloaded with their proper names.
Most frequent error is:
Assets/Add-ons/EasyRoadsMeshGen/MeshGen.js(126,37): BCE0005: Unknown identifier: ‘NavPoint’.
and you can either follow the aforementionend method (Delete NavPointGizmos.js and the Gizmos folder and re-importing)
or renaming the NavPointGizmos script to NavPoint and moving it to the root folder - EasyRoadsMeshGen (However keep in mind that this method, although safer for any scene/prefab references, may be prone to errors).
Converting to v2018 C#
As of version v2018 the tool is completely ported to C#. The new C# scripts are put in a differently named folder “EasyRoadsMeshGen_CS” to avoid problems with the old package.
There are two ways to convert from the old JavaScript tool to the C# version.
The first way of converting is to completely remove the “EasyRoadsMeshGen” folder from your project, which will make all the objects that have previously had the MeshGen.JS script show up a “Missing” warning. After that you reimport the package from the Asset Store. Then you simply drag the ERMeshGen.CS script on top of the script slot of the message.
The second way is to delete the old MeshGen.JS script on your GameObject and add the ERHelper.CS script to it alongside ERMeshGen.CS. Then you will need to setup the road’s width, subdivision, UV scale, etc. and after that go to the ERHelper.CS component and click “Fix Nav Points” which will assign all the existing child Nav Points to the navPoint array (as long as they haven’t been renamed manually). The downside of doing things this way is that you will have to manually set the road parameters, however unlike the first way, you won’t be forced update all of the Game Objects that use the old scripts, which allows you to gradually switch to the new package as you use it.
Does the tool have crossroads
As of writing this edit (v2020.1 - 22.7.2020) there are ways to achieve crossroads, and have been for a long time, via the “Snap point” functionality, using a pre-made crossroad prefab to which you can snap the road’s nav points. More intuitive solutions may become available with future versions.
Official video introduction to the tool
For support:
e-mail: hropenmail01@abv.bg
Twitter: @KrisDevelopment