[UE5]How to dynamically spawn an actor from content?

I have a Blueprint actor in my content folder. I’m trying to remove a tree instance (this works fine) and replace it with an individual actor. I’ve looked a plenty of examples and I just can’t get this to work.

I’ve tried ConstructorHelpers::FClassFinder, LoadObject and StaticLoadClass and none of them work. I’ve used the reference from the editor.

“/Script/Engine.Blueprint’/Game/TopDown/Blueprints/BP_FellTree1.BP_FellTree1’”

I’ve tried removing the “/Script/Engine.Blueprint” and the single quotes, no luck. I’ve tried remove the duplicate term after the period. I’ve tried all sorts of combinations and nothing works.

The class doesn’t exist in the level initially because I use instances to start. Is it possible to dynamically spawn assets in the content folder?

edit: And just as I wrote this post, I tried removing the part with the period and the remainder and it works with FClassFinder. I’ll now see if I can spawn the tree. But if someone knows of an easier way, please let me know.

It’s working for some actors, but not others.

edit: Loading blueprints works with FClassFinder. But I can’t find any way to dynamically load a static mesh.

I spawn Actor in the following way:

SpawnClass

My Products

I’m using C++. I did it the old school way. Inside a dummy game actor, I created a TMap of classes for blueprints and a TMap of static meshes. I add all the assets I want to use here so that they’re loaded. And I have direct access to the class or state meshes. I simply could not get LoadObject or FClassFinder to work.