« Tutorials Overview

 
 

Nested Custom Crossings



For ordinary custom prefabs a single mesh usually works just fine.

But the Custom Connection Prefab system can also be used for other purposes and sometimes a custom crossing can be too complex to build with one model. This usually is the case when connections on different height levels are involved.

In this case building the custom prefabs separately can be more efficient. Afterwards you can drag both prefab in the scene, add one of two as a child to the other prefab and update the prefab (top menu > GameObject > Apply Changes To Prefab). When instantiating the parent prefab both prefabs will be added to the scene and both will be fully functional.

It is recommended to keep the original prefab that was used as a child just in case you want to make changes to it in a later stage.


Custom Prefab
X Crossing RA Prefab
Level
Advanced

This residential area type of crossing can be used by itself. However for this purpose we also wanted to bring a sewer system to the map. Note that the sewer prefab itself was put together quickly adn mainly serves as an example of how else you can use this tool.

 

The setup

The crossing and the sewer system are two different prefabs for which connections were set up separately. After that was done the "X Crossing RA Sewer" object was added as a child to the crossing prefab like explained above.

 

How to create this in an efficient way in the scene?

After activating the "RA Zone" local grid (General Settings > Scene Settings > Local Grids, near the bottom, or the L key) we dropped 4 crossings in the scene. They will snap automatically to the desired local grid points. We moved the sewerTop child object a little bit aside to create the opening to the sewer area.

Next we disabled the terrain object to make the sewer connections clearly visible. The sewer pipelines were simply pulled out of a connection and snapped to the connection on the other end in one move holding the left mouse button down. For the sewer pipelines we want the normals to point inwards. To achieve that, select the road and in the Inspector click the "Flip Normals" button next to "Flip Road Texture".

 

 

After creating all the sewer pipelines the terrain can be activated again and all road sections can be created between the crossing connections. Again, simply pull out a new road section from a connection and snap it to the connection on the other end in one go.

 

Sewer Entrance Hole

By default the terrain will be visible at the sewer hole. There are several packages on the asset store that can create holes in a terrain if you are using an older version of Unity then version 2019.3.

In Unity 2019.3+ the hole can be cut in the terrain object directly from the terrain toolbar > Paint Terrain Tab> Paint Holes

EasyRoads3D v3.2.x will have more terrain features also covering hole creation automatically, also for tunnels.