1.2 - Automatic Wall

An overview of the Advanced Blueprints example level, example 1.2: Automatic Wall

On this page


The BP_Fence Blueprint uses the Construction Script to generate a row of Static Mesh Components extending from a start point to an end point. The location of the root Scene Component is treated as the starting point, while a vector variable represented as a 3D widget is treated as the end point. The script determines how many StaticMeshComponents are needed to bridge the gap between the start and end points, and then adds them in a row, attaching each new Static Mesh Component to the initial Static Mesh Component at the start of the wall. Finally, the initial Static Mesh Component is rotated to face the end point along its X axis, causing the rest of the row to rotate with it.

To show a vector variable's 3D widget, check the Show 3D Widget option, available in the Details panel of the Blueprint Editor when that variable is selected.

Construction Script

Click for full size or right-click and Save As.

  • A ForLoop node is used to repeat a section of script. The Index output from the ForLoop node is multiplied by the variable MeshWidth to calculate the location offset for each added Static Mesh Component.

  • The End point variable is a vector variable, which is Editable so users can type in exact X, Y, and Z values for the vector. Show 3D Widget is set to true for this variable, so users can also select and drag the 3D widget around in the level to set the end point for the fence.

Select Skin

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback