FSoftObjectPath's ResolveObject() and TryLoad() do not work for PACKAGED build?
I've successfully loaded Blueprint assets dynamically by using FSoftObjectPath to ResolveObject() and TryLoad(), but ONLY IN EDITOR.
When I try to run the same code in a package build or dedicated server, I get the "LogUObjectGlobals:Warning: Failed to find object..." error, which I believe typically occurs when you haven't cooked your required assets properly. The thing is, however, I have cooked everything and even tried using "Cook everything in the project content directory"... to no avail.
The code is as follows:
(I also read somewhere that UBlueprint doesn't work in Packaged builds, so my code uses UBlueprintCore instead)
Is this not the right method for loading assets dynamically in a packaged game? I have read about the FStreamableManager, but that appears to be a much more involving solution than necessary for what I'm trying to do.
Again, the code works perfectly in editor, so I assume this has to do with the running a packaged build.
asked Nov 30 '17 at 11:45 PM in Packaging & Deployment
In my previous post (that you reference in your answer), the class was loaded in the constructor, which wasn't satisfying for a complete dynamic loading.
I opened a BR for the exact same problem (thinking the problem was elsewhere in an asset manager function) and found out it wasn't a bug, just UE4 making things more difficult than they should.
I finally figured out it was again the same problem showing up one more time, and so i posted a complete working solution here once and for all:
Hopefully it'll help many people bumping into the same problem :-)
answered Dec 06 '17 at 07:00 PM
The above link was very helpful. I'm now using "Class'/.. /../name**_C" for the asset names instead (i.e. need to do some work on the reference copied from the UE4 engine first) and they are spawning in package and editor both. Sweet.
Follow this question
Once you sign in you will be able to subscribe for any updates here