When compiling, I get a warning about the constructor.
ObjectProperty FItemInShelf::ActorItem is not initialized properly even though its struct probably has a custom default constructor.
The constructor initializes all members of the class. I absolutely do not understand the reason for the warning.
FItemInShelf::ActorItem is an AActor* it is assigned nullptr or another AActor* depending on the constructor.
Structure:
USTRUCT(BlueprintType)
struct FItemInShelf
{
GENERATED_BODY()
public:
FItemInShelf()
{
SocketsName = FName("None");
PointLocation = FVector::ZeroVector;
PointRotation = FRotator::ZeroRotator;
PointTransform = FTransform::Identity;
PointWorldTransform = FTransform::Identity;
ActorItem = nullptr;
Take = false;
}
FItemInShelf(FName InName, FVector InLoc, FRotator InRot, FTransform InTrans, FTransform InWorldTrans, AActor* InActor, bool InTake) : SocketsName(InName), PointLocation(InLoc), PointRotation(InRot), PointTransform(InTrans), PointWorldTransform(InWorldTrans), ActorItem(InActor), Take(InTake) {};
FItemInShelf(FName InName, FTransform InTrans, FTransform InWorldTrans, AActor* InActor, bool InTake) : SocketsName(InName), PointTransform(InTrans), PointWorldTransform(InWorldTrans), ActorItem(InActor), Take(InTake) {};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
FName SocketsName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
FVector PointLocation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
FRotator PointRotation;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
FTransform PointTransform;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
FTransform PointWorldTransform;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
//TWeakObjectPtr<AActor> ActorItem;
AActor* ActorItem;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shelf")
bool Take;
FString ToString() const;
};
Any Idea ? It may not be possible to initialize AActor* = nullptr if UPROPERTY is used?