Native components are editable when declared as a property in c++

I just made a ammo crate from actor class and it compiles good but when I go to my mesh propties it won’t let me click on a mesh it said’s, native components are editable when declared as a property in c++ but i did do that here’s my code if u guys can help me


#include "Core.h"
#include "GameFramework/Actor.h"
#include "pickup.generated.h"

class HORDE_API Apickup : public AActor

	// Sets default values for this actor's properties



	UPROPERTY(editanywhere, Category = "Ammo Crate")
		class UBoxComponent  *pickupbox;

	UPROPERTY(editanywhere, Category = "Ammo Crate")
	USceneComponent *pickuproot;

	void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

	UPROPERTY(editanywhere, Category = "Ammo Crate")
		int32 count;

	UPROPERTY(editanywhere, Category = "Ammo Crate")
	UStaticMeshComponent* pickupmesh;

	// Called when the game starts or when spawned
		virtual void BeginPlay() override;

	// Called every frame
	virtual void Tick(float DeltaTime) override;



include "pickup.h"
#include "Components/StaticMeshComponent.h"
#include "Components/BoxComponent.h"
#include "hordeCharacter.h"

// Sets default values
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = false;

	pickuproot = CreateDefaultSubobject<USceneComponent>(TEXT("pickuproot"));
	RootComponent = pickuproot;

	pickupmesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("pickupmesh"));
	pickupmesh->AttachToComponent(pickuproot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);

	pickupbox = CreateDefaultSubobject<UBoxComponent>(TEXT("pickupbox"));
	pickupbox->SetWorldScale3D(FVector(1.0f, 1.0f, 1.0f));
	pickupbox->bGenerateOverlapEvents = true;
	pickupbox->OnComponentBeginOverlap.AddDynamic(this, &Apickup::OnOverlapBegin);
	pickupbox->AttachToComponent(pickuproot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);

	count = 90;



void Apickup::OnOverlapBegin(UPrimitiveComponent * OverlappedComp, AActor * OtherActor, UPrimitiveComponent * OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
	AhordeCharacter *character = Cast<AhordeCharacter>(OtherActor);

	if (character)
		character->Maxammo = character->Maxammo + count;


// Called when the game starts or when spawned
void Apickup::BeginPlay()

// Called every frame
void Apickup::Tick(float DeltaTime)


I think the issue is the editanywhere specifier on your components. Use a visible specifier like VisibleAnywhere instead of an edit specifier. You might need to remake the blueprints after that change.

Some on point discussion is here in comments:

1 Like