Drawing a Road
Drawing a Road
Use the Road component to create a worn-looking footpath that leads to the maze entrance and away from the maze exit.
In this procedure, you first draw out the meandering line of the road and adjust it to give some variation in the road’s height. You then align the road so that the surrounding landscape slopes up and down to the height variations of the road. Finally, assign a dirt texture to the road.
To create a path with the Road component
In the viewport, right-click and choose Create entity.
In the Entity Inspector, enter a name for the entity such as Road.
Choose Add Component and choose the Road component.
Under the Road component, click Add Required Component, and then choose the Spline component.
ExampleThe Road entity and its components should look like the following.
To extend the length of the road, select and drag the [0] vertex on the spline towards the entrance of the maze.
Select and drag the [3] vertex in the opposite direction.
ExampleThe Road entity should look like the following.
Add more vertices to the spline so that you can adjust its position and give it a more organic curve. To add a vertex, select the Road entity, press and hold CTRL, and then click along the center line of the Road component. Repeat until you have about 10 vertices total.
ExampleThe Road entity should now look like the following.
Select and drag the vertices along the ground to form curves, so that the road has a more organic shape along the ground.
ExampleThe Road entity can look like the following.
Select the Road entity, and then select and drag a few of the vertices up or down along the path so they rise just above or below the existing terrain.
ExampleYour Road entity can look like the following.
In the Entity Inspector, for the Road component, choose Align heightmap. This automatically adjusts the terrain around path to match its position.
You can add more vertices to the Spline component, adjust their position and then choose Align heightmap again.
ExampleYour Road entity should look like the following.
To change the material for the road, in the Road component, for Road material, click the (…) icon.
In the Pick Material dialog box, navigate to
StarterGame/Materials/Natural/Road
and select theam_road_dust_rocks
material file and then choose OK.
ExampleYour path should look like the following.
Note
You can adjust the behavior and appearance of the Road component with other properties. For more information, see the Road component in the Amazon Lumberyard User Guide.Repeat this procedure to create another path that leads away from the maze’s exit.
Press Ctrl+S to save your level.