rdInst Tutorial 42 – DataLayer Proxies
Last Updated: 15th July 2024
Tutorial created using rdInst version 1.42
Download Project (5.30 up) (811MB)
Version 1.42 of rdInst also includes the ability to swap in DataLayers when in proximity to specified meshes in your level.
It references the DataLayers with a soft reference so you have the option to have the DataLayers unloaded initially.
Note that DataLayers are only available in 5.0 with WorldPartition enabled. 4.27 DataLayers work with normal levels.
This tutorial just adds some starter content furniture to a DataLayer and swaps it in when in proximity to a plant mesh.
Step 1. Create a new level using FirstPerson Template
Create a new project, based on the FirstPerson Template, and include the Epic Starter Content.
Then create a new World Partition level (Open World), if in UE5.0+ or a normal level in 4.x
Step 2. Add some furniture meshes to the level.
Add some meshes to the level that you want to use in the DataLayer and save your project.
Step 3. Create a DataLayer and Assign the Actors to it.
Now Right-Click in the content browser and choose “Create->Misc->DataLayer”
Now double click to open it, and change the DataLayer Type to “RunTime”:
Make sure you have a “DataLayers” window open (if not, open it from the Windows menu) and drag the new DataLayer Asset into the Item List to create an instance of it. Call it something like DL_Furniture.
Now select the furniture actors in the level (or outliner) and drag them into the DataLayer instance.
Last thing is to set it’s initial visibility to hidden:
That’s the DataLayer done. You can test it in the editor by clicking the eye icon besides the DataLayer Instance in the Items list.
Step 4. Create a Blueprint to Add the Plant ISM.
Create a new Blueprint based on Actor, call it something like “BP_AddDataLayerProxy” and open it in the Blueprint Editor.
The SM_Bush static mesh that we’ll be using needs to have it’s ISM usage flag ticked, so open it up in the material editor and tick it’s box.
It doesn’t have any collision by default, so just add a collision capsule for ease:
And we need to add Collision to the mesh, if you have rdBPtools – right-click on the mesh in the content browser and select “Instance Settings” – that opens a window where you can set the collision to Enabled. If you don’t have rdBPtools, follow this tutorial.
Add the code below to the BeginPlay event in the Event Graph. Note that the “Proxy DataLayer Name” is the reference to the DataLayer asset minus the starting Asset Type and “/Game/”, right-click on your asset and select the “Copy Reference” option, then paste into the DataLayer Name field and remove the “/Script/Engine.DataLayerAsset’/Game/”.
Step 5. Turn on Proxy Scanning.
Select the “rdInst Settings” actor from the outliner, and change the “Process Interval” to “5”.
Step 6. Done.
That’s it – now just play the level and watch the DataLayer show and hide depending on proximity.