… Will the directory “/FPSProject” be evaluated as
E:/Unreal/Projects/FPSProject/Source/FPSProject/
or
E:/Unreal/Projects/FPSProject/
What is the prefix of the path in FObjectFinder’s argument?
In the following code, the argument is “StaticMesh’/Game/StarterContent/Props/MaterialSphere.MaterialSphere’”
What is “StaticMesh” in that argument?
Is it a class type, a file name, a directory?
What happens if you exclude it?
I’ve been stuck on this for a while, so any help would be appreciated.
Also any examples and explanations of how to use FObjectFinder, and how it works, would be very helpful.
The path is relative to your (or the engines, or a plugins) content folder. For example:
/Game/Folder/Asset.Asset will be /Project/Content/Folder/Asset.uasset on disk.
/Engine/Folder/Asset.Asset will be /Engine/Content/Folder/Asset.uasset on disk.
/PluginName/Folder/Asset.Asset will be something like /Engine/Plugins/PluginName/Content/Folder/Asset.uasset.
If you’re wondering about the Asset.Asset thing, that’s because you’re loading a uasset package called Asset and then the object that is also called Asset from that. Pretty much the only time you need to change this convention is when loading a blueprint, where you need Asset.Asset_C to get the generated class object.
The “prefix” lets you filter what type of object to load. It is more of a relict and not particularly useful, since you’re already filtering by class when loading things. I’d just leave it out.
Going back to your example, the path you want is “/Game/Models/SK_Mannequin.SK_Mannequin”