What is the difference between TAssetSubclassOf and TSoftObjectPtr?

This may seem like a simple question, but I was wonder the difference between TAssetSubclassOf and TSoftObjectPtr.

I believe that TAssetSubclassOf references the base class of an asset that you are trying to load asynchronously. I’ve used this to load assets in the past. I believe this returns a purple peg in blueprints once it is loaded (as it is returning the class object).

TSoftObjectPtr seems to be a replacement of TAssetPtr. This is used to asynchronously load an object and return a pointer to it (Blue peg in blueprints?). Instead of returning a blueprint, this can be used to return a loaded asset (such as a Material or Texture).

Is this thinking correct? Hopefully someone can quickly clear this up for me. Thanks!

2 Likes

For those looking for clarity, I have posted the answer here:

TAssetSubclassOf is now called TSoftClassPtr. A TSoftClassPtr can be used to async load a class (purple peg) from a given path. This allows you to access defaults (GetDefaultObject) and the such from the class itself. You can also use this to spawn actors from class.

TSoftClassPtr will create a PINK blueprint peg. This peg can then be dragged to async load into a PURPLE object class peg (you may need to cast to AActor in order to access SpawnActor).

TSoftObjectPtr can be used to Async load an object itself. This works for objects that aren’t spawned in the world such as a Texture Object. It will allow you to choose your object that you can load asynchronously. This is a LIGHT CYAN peg that will load into a BLUE reference peg. There’s no real way to select an actor using this method as the selection only allows you to reference actors currently in the world.

1 Like