What is the difference between construction script and event graph?

The construction script is mainly for modular development in editor. So for something like creating a road with guard rails and lines and a curb or a concrete barrier etc you can script all the logic for how to do this in the construction script of a spline actor. Inside the construction script you will add as many variables as you need to control all the modular and dynamic aspects of this road construction tool. Now when you drag into the world/viewport this modular tool it will likely be blank or just have one little mesh. But the beauty of the construction script when used well is that you can now “create” a road with all these little features when and where you want them to be as you drag out spline points in real time. So you start off with a spline actor that auto populates the first point with a static mesh for a road. You then drag out a second spline point and watch the construction script auto generate a second section of road. You then drag out a third spline point and once again create another section of road automatically. In addition to this third section of road, you go to the details panel and check off a few boxes (variables set up in the construction script) that allow you to add a concrete barrier or a curb or a tree, or perhaps change the static mesh material from concrete to brick etc. The construction script allows you to “construct” an actor as you go from within the editor. The event graph on the other hand allows you to say, when the player runs into the concrete wall spawn a particle system for an explosion and damage the player vehicle. Code in the event graph requires game play to run, code in the construction script simply requires an instance of the actor to be present in your level for it to run. The construction script runs before anything really happens. It does all its work before you start playing, before anything in the event graph is even started. The event graph does the exact opposite. It does nothing until you hit play.

17 Likes