Prefabs are hierarchies of entities and components you can use to construct reusable gameplay objects in UEFN.
This page walks you through the creation of five different prefabs:
Prefab_TriggerableMesh
Prefab_TriggerableLight
Prefab_TriggerableMovingMesh
Prefab_PuzzleManager
Prefab_Trigger
Triggerable Mesh Prefab
The Prefab_TriggerableMesh is a prefab with the following hierarchy:
Entity:
transform_component,mesh_component,triggerable_mesh_component
The transform_component is included on all entities by default. This is because all entities physically exist in the level and, in order to exist in the level, they must have a transform that enables them to be located. To create the Prefab_TriggerableMesh, follow these steps:
Navigate to the Quickly Add to Project button and place an actor by dragging Entities > entity into the level.
Rename the entity by right-clicking the entity in the Outliner and selecting Edit > Rename then changing the name to Prefab_TriggerableMesh.
Add the
mesh_component.undefinedNavigate to your Prefab_TriggerableMesh entity then click the +Component button in the Details Panel and search for
mesh_component.Once you search for
mesh_component, you must choose a specific mesh. In this case, choose the provided plane basic shape mesh.
Add the
triggerable_mesh_component. Navigate to your Prefab_TriggerableMesh entity then click the +Component button in the Details panel and search fortriggerable_mesh_component.To make this a prefab, right-click on the Prefab_TriggerableMesh and select Save As Prefab…
A Create New Prefab dialog pops up where you can change the name of your new class or choose the content path for your class. Once you are satisfied with your choices, choose Create Entity Class. You can now choose this prefab in the Content Browser and place it in the level to use and configure each instance as you want.
You'll repeat a similar process for the other prefabs you create in this project.
Triggerable Light PrefabThe Prefab_TriggerableLight is a prefab with the following hierarchy:
Entity:
transform_component,triggerable_light_componentEntity:
transform_component,mesh_componentEntity:
transform_component,mesh_component, light_component
To create the Prefab_TriggerableLight, follow these steps:
Navigate to the Quickly Add to Project button and place an actor by dragging Entities > entity into the level.
Rename the entity by right-clicking the entity in the Outliner and selecting Edit > Rename then change the name to Prefab_TriggerableMesh.
Add the
triggerable_light_component. Navigate to your Prefab_TriggerableLight entity clicking the + Component button and searching fortriggerable_light_component.Navigate to the Prefab_TriggerableLight entity in the Outliner. Right-click on the entity and choose Add Entity… > entity. Rename this entity to LightOff.
Customize the LightOff entity.
Choose the LightOff entity in the Outliner. Navigate to the Details Panel and click the +Component button to add a mesh_component, then choose the sphere mesh.
Navigate to the Prefab_TriggerableLight entity in the Outliner. Right-click the entity and choose Add Entity… > entity. Rename this entity to LightOn.
Customize the LightOn entity.
Choose the LightOn entity in the Outliner. Navigate to the Details panel and click the +Component button to add a mesh_component, then choose sphere mesh. Change the following editable fields on the mesh_component to:
Uncheck the Enabled checkbox.
Choose the LightOn entity in the Outliner. Navigate to the Details panel and click the + Component button to add a sphere_light_component. Change the following editable fields on the sphere_light_component to:
Uncheck the Enabled checkbox.
Intensity: 10.0
AttenuationRadius: 1000.0
SourceRadius: 50.0
To make this a prefab, right-click the Prefab_TriggerableLight and select Save As Prefab…
A Create New Prefab dialog pops up where you can change the name of your new class or choose the content path for your class. Once you are satisfied, choose Create Entity Class. You can now select this prefab in the Content Browser, place it in the level to use, and configure each instance as you want.
Triggerable Moving Mesh PrefabThe Prefab_TriggerableMovingMesh is a prefab with the following hierarchy:
Entity:
transform_component,triggerable_movement_component,mesh_componentEntity:
transform_componentEntity:
transform_component
To create the Prefab_TriggerableMovingMesh, follow these steps:
Navigate to the Quickly Add to Project button and place an actor by dragging Entities > entity into the level.
Rename the entity by right-clicking the entity in the Outliner and selecting Edit > Rename, then change the name to Prefab_TriggerableMovingMesh.
Add the
triggerable_movement_component. Navigate to your Prefab_TriggerableMovingMesh entity clicking the +Component button and searching fortriggerable_movement_component.Add the
keyframed_movement_component. Navigate to your Prefab_TriggerableMovingMesh entity by clicking the +Component button and searching forkeyframed_movement_component.Add the
mesh_component.Navigate to your Prefab_TriggerableMovingMesh entity by clicking the +Component button and searching for
mesh_component.Once you search for
mesh_component, you must choose a specific mesh. In this case, choose the provided plane basic shape mesh.
Navigate to the Prefab_TriggerableMovingMesh entity in the Outliner. Right-click the entity and choose Add Entity… > entity. Rename this entity to TransformOne.
Navigate to the Prefab_TriggerableMovingMesh entity in the Outliner. Right-click the entity and choose Add Entity… > entity. Rename this entity to TransformTwo.
Make this a prefab by right-clicking the Prefab_TriggerableMovingMesh and selecting Save As Prefab…
A Create New Prefab dialog pops up where you can change the name of your new class or choose the content path for your class. Once you are satisfied , choose Create entity Class. You can now choose this prefab in the Content Browser, place it in the level to use, and configure each instance as you wish.
Puzzle Manager Prefab
The Prefab_PuzzleManager is a prefab with the following hierarchy:
Entity:
transform_component,puzzle_component
To create the Prefab_PuzzleManager, follow these steps:
Navigate to the Quickly Add to Project button and place an actor by dragging Entities > entity into the level.
Rename the entity by right-clicking the entity in the Outliner, selecting Edit > Rename, and changing the name to Prefab_PuzzleManager.
Add the
puzzle_component. Navigate to your Prefab_PuzzleManager entity clicking the +Component button and searching forpuzzle_component.Make this a prefab by right-clicking the Prefab_PuzzleManager and selecting Save As Prefab… .
A Create New Prefab dialog pops up where you can change the name of your new class or choose the content path for your class. Once you are satisfied, choose Create Entity Class. You can now choose this prefab in the Content Browser, place it in the level to use, and configure each instance as you wish.
Trigger Prefab
The Prefab_Trigger is a prefab with the following hierarchy:
Entity:
transform_component,trigger_component,mesh_component
To create the Prefab_Trigger, follow these steps:
Navigate to the Quickly Add to Project button and place an actor by dragging Entities > entity into the level.
Rename the entity by right-clicking the entity in the Outliner, selecting Edit > Rename, and changing the name to Prefab_Trigger.
Add the
trigger_component. Navigate to your Prefab_Trigger entity by clicking the +Component button and searching fortrigger_component.Add the
mesh_component.Navigate to your Prefab_Trigger entity by clicking the + Component button and searching for
mesh_component.Once you search for
mesh_component, you must choose a specific mesh. In this case, choose the provided plane basic shape mesh.
Make this a prefab by right-clicking the Prefab_Trigger and selecting Save As Prefab… .
A Create New Prefab dialog pops up where you can change the name of your new class or choose the content path for your class. Once you are satisfied, choose Create Entity Class. You can now choose this prefab in the Content Browser, place it in the level to use, and configure each instance as you want.
Next Steps
Now that all prefabs have been constructed from Scene Graph entities and components, all these pieces can be put together to create a puzzle in UEFN.