This is the first in a series of articles related to the Scene Graph system in UEFN.
Epic Games and many developers have emphasized the importance of the Scene Graph system, but for some developers or newcomers to UEFN, the benefits of learning and using Scene Graph may not be so clear.
First of all, the Scene Graph system does not replace the Creative Device system that has been available in UEFN since its launch. Let's compare the two systems:
- Creative Device System: This is a high-level system focused on gameplay programming that allows for the manipulation of devices.
- Scene Graph System: This is a low-level system that allows the use of the Verse language to manipulate the entities that make up the scene and to program custom components.
The Scene Graph is a structure that represents the elements of a scene in a hierarchical way and has these three fundamental concepts:
- Entity: It is a container where components are placed. An entity can also contain other entities.
- Component: This is what gives life to an entity. An entity can contain several components to define its physical, visual, and behavioral aspects. New components can be programmed using the Verse language.
- Prefab: It is used to group a hierarchy of entities and components into a class and store it as a project asset. Multiple instances of a Prefab can be added at the level, and the Prefab class can be used directly in Verse code.
In this article, we will look at a basic workflow that involves these three concepts. It is very important that these concepts are clear before delving deeper into the study of the Scene Graph.
The first step is to create an empty entity at the level. This is done from the Place Actors tab, which can be opened in the top Window menu.
In the category icons on the left, select Entities and drag the entity into the level.
In the Details tab, you'll see that the entity added to the level has a transform_component, which is used to define the entity's location within the level.
Click the +Component button to add more components. A list of available components will be displayed. Some component types are abstract and require you to choose a subclass. For example, select mesh_component.
The static meshes available as mesh_component are the basic shapes listed below. Select the cone.
To use custom Static Meshes, you need to import the FBX files or create them using the UEFN modeling tools.
Now let's add another mesh_component to the entity that was created. However, if you click on +Component you will see that the mesh_component no longer appears in the component list. This happens because an entity can only have one component of each type.
We will need to create a child entity to add the mesh_component to this new entity. In the Outliner tab, right-click on the entity that was created and select Add Entity > entity:
In the Details tab of the child entity, click the +Component button and select mesh_component > cube. This cube will be used as the tabletop, so change the Scale of the UP axis (green) to 0.1.
In the level editor, use the green arrow to position the tabletop on top of the cone:
The next step is to convert this hierarchy of entities and components into a Prefab. It will be stored as a project Asset. This will allow instances of this Prefab to be added at the level using the level editor or Verse code.
In the Outliner tab, right-click the parent entity and select Save As Prefab... :
The Prefab editor will display our new Prefab for editing. Close the Prefab editor and access the Content Drawer to view the created Prefab asset. In my example, the UEFN editor created a folder with the same name as the project folder:
Drag and drop the Prefab within the level to create new instances:
In this article, we'll stop here. In the next articles, we'll look at Entities, Components, and Prefabs in more detail. We'll also learn how to program our own component using Verse.










