when using Uproperty EditDefaultsOnly it prevents me from saving when I have an actor with it in the map as seen in the class bellow. I have a feeling I am missing something that would make this work but I cannot find what it is.
UCLASS()
class CHIEFSOFMISCHIEF_API AWorldActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AWorldActor();
AWorldActor(UInventoryObject* itemRef);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
void SetItemType(EItemTypeEnum type = EItemTypeEnum::IT_NONE);
void SetItem(UInventoryObject* item);
UPROPERTY(Replicated, BlueprintReadOnly, Category = "Location")
FVector WorldLocation;
UPROPERTY(Replicated, BlueprintReadOnly, Category = "Location")
FRotator WorldRotation;
void UpdateWorldPos();
void SetWorldPosRot(FVector pos, FRotator rot);
public:
UPROPERTY(EditDefaultsOnly, Category = "Default")
TSubclassOf<UInventoryObject> ItemClassRef;
// Called every frame
virtual void Tick(float DeltaTime) override;
UFUNCTION(BlueprintCallable, BlueprintPure)
EItemTypeEnum GetItemType();
UPROPERTY(Replicated, BlueprintReadOnly, Category = "Info")
UInventoryObject* ItemReference;
};
this is the class it is referencing:
UENUM(BlueprintType)
enum class EItemTypeEnum : uint8 {
IT_NONE UMETA(DisplayName = "None"),
IT_Weapon UMETA(DisplayName = "Weapon")
};
/**
*
*/
UCLASS(Blueprintable)
class CHIEFSOFMISCHIEF_API UInventoryObject : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadOnly, Category = "Info")
EItemTypeEnum ItemType = EItemTypeEnum::IT_NONE;
};