# Am i implementing soft class reference correctly?

**URL:** <https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [January 14, 2023, 6:47pm UTC](https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376 "2023-01-14T18:47:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [January 14, 2023, 6:47pm UTC](https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376/1 "2023-01-14T18:47:48Z")

</div>

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?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/8/8f8dfb0a95067c75e9cfee98c0ab8a93216d4d3f.png)

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.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 14, 2023, 7:53pm UTC](https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376/2 "2023-01-14T19:53:43Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [January 14, 2023, 8:59pm UTC](https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376/3 "2023-01-14T20:59:22Z")

</div>

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:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/c/68cfde5686114f6d998ba74cd279eef3b072e21f.png)

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?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 14, 2023, 9:29pm UTC](https://forums.unrealengine.com/t/am-i-implementing-soft-class-reference-correctly/749376/4 "2023-01-14T21:29:54Z")

</div>

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

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