Am i implementing soft class reference correctly?

Hello, can anybody confirm that what I am doing makes sense here:

The goal is to grab a soft class reference from data table, ensure that the class is loaded to memory (Load Class Asset Blocking), and then actually spawn an actor of the class.

The intent for using soft class reference here is so that anybody looking at this data table is not loading all the classes that will be in the data table.

If I understand correctly, it is necessary to Load Class Asset Blocking because the resolve node will not actually load a class - it could return null.

If I understand correct, the resolve node is effectively saying, “follow this given path to find a desired class, and then seek out that class from where ever it is in memory. Thus, it is required that the class is in memory. If it is not, hey, that’s not my job!”

The Load Class Asset Blocking node tooltip does say that an Async node should be preferred, however that node that is recommended does not appear in context search, so I guess it does not apply to a situation like this?

Some more specific context - this sort of spawning would be happening infrequently, and only one actor at a time. The actors being spawned are lightweight and are completely decoupled. So I don’t think its really needed to load them asynchronously, though I am just speculating about that. This is the “deepest” I’ve gone with blueprints so far.

I appended a bit of extra info to and old post the other day, was that you? :slight_smile:

The code looks fine, of course, but the acid test is the ‘size map’ of this BP.

I discovered that putting a class directly into ‘load asset’ keeps the BP clean, but simply having it as a variable or in an array, will cause a hard reference.

I’m assuming existing in a data table is enough hiding, but the size map will tell.

Not sure about old post, i havent seen any update notifications. though if its just edited post i dont think that would trigger any notifications?

The size map and reference viewer seem clean:

This indicates that the data table includes soft reference to some classes. I’ll know of course if the actors get spawned or not, but is there anywhere that will notify when things actually get loaded into memory? So that I can confirm what I expect to happen is happening?

There is quite a few profiling tools, I imagine one would put out a log that indicates when stuff gets loaded?

The sizemap will tell if they will load into memory. It will clearly have all the classes you’re using. So it sounds ok :slight_smile:

( just try making a soft class ref variable, you’ll see it )