Hey,
Is it possible to have a USkeletalMeshComponent with UPROPERTY(EdtiAnywhere…) in a custom UObject class?
This UObject class is created as BP inside the editor, because I want to set the default USkeletalMesh there.
And somewhere else this UObject with the default values is created with NewObject<>()…
Custom UObject:
UCLASS(Blueprintable)
class LEARNING_API UCustomObject : public UObject
{
GENERATED_BODY()
public:
UCustomObject();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VALUES")
USkeletalMeshComponent* cloth_;
};
for example in the Character class:
.h
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="CUSTOM")
TSubclassOf<UCustomObject> custom_cloth_class_;
private:
UCustomObject* custom_;
.cpp
void Character::BeginPlay()
{
custom_ = NewObject<UCustomObject>(this, custom_obj_class_);
custom_->cloth_ = //create the USkeletalMesh?????
}