So this is what I’m struggling with.
I have a class which extends from USceneComponent which attaches to actors with Add Component and I can edit the UPROPERTY’s I’ve created for it just fine as well, let’s call this component, A.
Now I’ve created a class which extends from UActorComponent, let’s call it B. The USceneComponent has a UPROPERTY tagged member of this UActorComponent type. In the editor, I get a drop down list in class A’s detail panel. However, I cannot select the B class, all that is there is None.
However, I can use the Add Component button to attach the B class to any actor, however, this is obviously not useful. I need to create an instance of class B in class A and set class B’s UPROPERTIES. I figure this dropdown list isn’t working because I need to create an actual instance of class B, and then link it to the class A’s member. How do I do this in such a way that I can edit the properties of the member B.
All of this is trivial in C++ but I’m trying to do more stuff that works with the Editor for convenience. What am I setting wrong? thinking wrong? etc
UCLASS(Blueprintable, ClassGroup=A, meta=(BlueprintSpawnableComponent))
class A : public USceneComponent{
public:
UPROPERTY(EditAnywhere, Instanced, BlueprintReadWrite, Category = "B thing")
UActorComponent* B= nullptr;
};
UCLASS(Blueprintable, BlueprintType, ClassGroup=B, meta=(BlueprintSpawnableComponent))
class B : public UActorComponent{
public:
//some UPROPERTY primitives
};