Unreal Engine Tips (5.0+)

This is just a tips page where I'm adding random discoveries about which you don't often find the answer by a Google (or insert your favourite search engine here) search.


For the time being they aren't categorized and if you're looking for something specific, I'd suggest using a text search of the page (CTRL+F on Windows and Mac for most browsers), if a search engine dropped you here.


The Order Of Creation Involving Hierarchy Of Objects

If you're wondering whether you should implement the management of child objects in a hierarchy such as FActors or Blueprint Actors and their child Components, the creation and event pipeline is run as follows:

The owner completes its execution of the Event Play function first, and then the calls the Event Play function for all of the child Components in what appears to be reverse alphabetical order by object name.

This order is likely the behaviour for all actions that involve processing of the hierarchy (child Actors and Components).

I haven't yet tested this against other classes that are child objects of an actor (eg. other actors, meshes etc).


Setting Unreal Engine Projects To A Difference Location Without Actually Moving Files (In Windows)

This solution is intended to give you the benefit of shorter path names for your project, as long path names can sometimes lead to errors when running/building your project.

It is generally intended if you don't need to actually move your files to another location for the sake of disk space.

It is essentially the same solution I posted on the Unreal Engine forums here:



Let's assume that the path to your default Unreal Engine Projects folder is:

.\Documents\Unreal Projects

In most systems it would be:

C:\Users\YourUserName\Documents\Unreal Projects

Open a command prompt window ([Windows + R] and then type: "cmd" and hit return).

In this example we'll set our Unreal Projects folder to the drive U: though you can choose a different drive letter assuming that its not already used by your system.

At the command prompt, type:

SUBST U: "C:\Users\YourName\Documents\Unreal Projects"

(Note: be sure to enclose the entire path line in quotes)

then hit the [ENTER] and if you did everything correctly you should have a new drive with the drive letter you selected and if you open it in explorer, it will lead directly to Unreal Projects.

Now, lets get Unreal Engine setup to look in the new location.

Using Notepad or another text editor open the file:

%LOCALAPPDATA%\EpicGamesLauncher\Saved\Config\Windows\GameUserSettings.ini

Find the line

CreatedProjectPaths=C:\Users\YourUserName\Documents\Unreal Projects

which will still have the old path to your files so we'll change it to:

CreatedProjectPaths=U:

Now save the GameUserSettings.ini file and all should be alright.

Next time you open Epic Launcher, in the Library tab you might see two copies of your projects. One with the old path and one with the new path. Technically, you could use either, but I'd suggest you use the new one with the shorter path (U:) as it can help avert compilation problems that arise from the length of the path.

You can use this same method to relocate your project files to a new location, just move them first and use the path from the new location as the destination path for your SUBST command prompt line, and for your CreatedProjectPaths line in the GameUserSettings.ini file.

If you want the drive to show up every time you boot your computer, just create a text file and insert the line:

SUBST U: "C:\Users\YourName\Documents\Unreal Projects"

(or the path to your Unreal Projects folder)

Now save that file as or rename it to:

UnrealProjectSubst.bat

Then copy the file to your Windows startup folder which can be gotten at by ([Windows + R] and then type: "shell:startup" and hit ENTER).

Next time you reboot, your new Unreal Projects folder drive should be there for you.


Using CreateAsset from the Skeletal Mesh Editor properly to create an animation or pose asset

When using the skeletal mesh editor and trying to create either a pose or animation asset, I've found through trial and error that the only way to successfully create and save either a pose or animation is to, after you've manually posed all of the bones in your mesh, to select all the bones in the Skeleton Tree that you'd like to include in the pose or animation first, or if having an absolute keyframe for every bone doesn't matter, then select them all [Ctrl+A].

Now click the Create Asset button (top middle-left in the interface) and create your pose or animation from there picking the appropriate menu item.

The key aspect here, is to first select the bones that you want to save with the pose or animation first. If you don't, no pose or animation data will be saved into the corresponding pose or animation file.

Also remember that saving all of the bone pose data might interfere with smooth transitions between morph targets, so choose carefully as to whether you only need the posed bones in you pose or animation file, or all of them. You could even save two different versions, one with all bones selected and one with only the posed bones selected if you're going to be mixing morph targets.


Control Rig And Array Parsing/Recursion


After using Control Rig (with an excellent Udemy course) and attempting to debug rig issues related to the use of the [Index] property of a Rig Element Key array, I discovered through debug printing that it appears that when building an array from a Control Rig Construction Event, that the For Each iterator operates recursively and parses rigs in backwards order (which seems to be the default behaviour of the For Each iterator as noted above in section: the order of creation involving hierarchies).

The solution to this first is to be aware of it and to avoid using the Index property of the Rig Element Key struct when possible. Despite the obvious performance issues involved with comparing strings in the midst of a running rig, there should be a way to distinguish between Rig Element Keys that allows access to a specific key (via its name).

Being certain of which bone name equates to which index in any arrays you've built is the key to performance when implementing conditional branches within a running rig.


Water Body Collision Profile

If you enable the water plugins in Unreal Engine 5+, you'll be presented with an error message in the log upon starting up that looks something like this:

Collision Profile settings do not include an entry for the Water Body Collision profile, which is required for water collision to function. Add entry to DefaultEngine.ini?

If the line Add entry to DefaultEngine.ini is underlined, you should be able to click the line directly in your message log, and Unreal Engine will automatically update your DefaultEngine.ini for you (it will happen quietly and invisibly, without any notifications or message dialogue).

If your DefaultEngine.ini is not updated, you can manually update it yourself. Copy and paste the following line into your DefaultEngine.ini (located in <YourProjectFolder>\Config) and add it to the [/Script/Engine.CollisionProfile] section:

+Profiles=(Name="WaterBodyCollision",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="",CustomResponses=((Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap)),HelpMessage="Default Water Collision Profile (Created by Water Plugin)")

This tip is courtesy of Yepkoo Community Threads and their corresponding YouTube presence.


=========

Thank you to Epic Games and the Unreal Engine community, from whom I learn every day.

Thank you to Udemy whose courses have been a great source of knowledge and ability regarding many involved matters of both film and application development.

This content is entirely produced in Toronto, Ontario, Canada at 200 Sherbourne Street Suite 701 under the Shhhh! Digital Media banner.