How to set actor blueprint class to child actor class of child actor component dynamically?

Hello,

I was wondering how to set child actor class of child actor component having the object path of the actor blueprint that i want to set.

What i have ➞ the object path of an actor blueprint

What i want to do ➞ to set above actor blueprint class to the set child actor class node of actor component.

Im sorry as i aint good enough with c++ yet. Any idea how to achieve it? Thanks!

329136-delete2.png

Hello! Why are you using FString to represent class?

I meant that input is a string of blueprint reference path and i want to get class of that blueprint so that i can set it to the input class of SetChildActorClass node.

Ok, so you can take a look at this:

The input is BP actor object path and output is class of that bp. I used ‘cast to actor’ this class and then set actor class to set child actor class.

void UClassNameFromBPObjPath::GetClassFromBPObjPath(const FString& BPActorObjectPath, UClass*& BPActorClass){

FStringAssetReference itemRef = BPActorObjectPath;
StaticLoadObject(UObject::StaticClass(), nullptr, itemRef.ToString());
UObject
itemObj = itemRef.ResolveObject();
BPActorClass = Cast(itemObj);
}