I am using an DataTable that contains information about UObjects to be created during runtime. I am using Soft Class References to avoid possible problems with loading too many classes into memory (so the solution for this other similar post is a no-go for me).
The problem is that sometimes, the class reference is passed as “none”, even though it is perfectly determined in the data table. To fix this, I have to clear and re-assign the soft class reference value. Still, I want to understand why this happens.
Have you tried using “Async Load Asset” on you soft reference? It’s basically just a link to the asset in the datatable. You need to manually load the asset for it to work.
Thank you! This solved it (actually, synchronous load also does the trick).
In case anyone is wondering how to do this in C++ (which was my case):
Synchronous Load:
Deference the TSoftClassPtr with the function SynchronousLoad()
Asynchronous Load:
You may find this post useful.
It explains how to use TSoftClassPtr::ToSoftObjectPath to Obtain an FSoftObjectPath and use it as described in the second half of this documentation.