Spline Tool

Overview

This tool was put together to be a quick and easy way to develop a platformer, being able to place and extend the meshes as needed.

The tool reacts to the length of the spline adding meshes as the length extends

Also the tool allows the flexibility of different platform styles and materials.

The logic of the tool can be replicated to fit needs of other projects as well.

How it works

Using both construction scripts and editor graph events it allows to be able to create the mesh as we use it, as well as allow the user to set their meshes when they are satisfied.

The core of the logic is based around how the meshes are created as the spline tool expands.

Calculate Meshes to create

By creating a pure function, I can feed the logic need in order to truncate the length of the spline in order to calculate the number of meshes to be created. This integer is fed into a For Loop which in turns creates the number of meshes needed for the spline.

From here we can can add spline mesh components in order to create a visual element for our mesh, assigning the parts the according meshes and materials.

Enumerations

Using enumerations it is possible to set predefined materials and meshes in order for the user to not need to waste time setting up. These enumerations are exposed so that the user can quickly change and select options that result in varying mesh shapes and sizes as well as different materials and colors.

Functions

It was important in order to create clean and reusable functions. By creating these functions it was possible reuse them in multiple places throughout the tool without needing to completely recreating large sections of nodes. Nesting functions also aids in the cleaning of Blueprints as well as providing a coherant understanding of what the portion of script is aimed to accomplish.

© 2022 Patrick Vasile