Actor destroying self on spawn

So I’m having a bit of a problem with collision detecting. very basic right? anyway I can detect an on overlap perfectly fine right. I create a bullet actor on a level and when it collides with something it destroys itself. the problem is that it now seems to destroy itself with spawned in by a player.

Anyway this is the header
UCLASS()
class TANKS2_API ABullet : public AActor
{
GENERATED_BODY()

public:
// Sets default values for this actor’s properties
ABullet();

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

UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UStaticMeshComponent* body;

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

UPROPERTY(EditAnywhere)
	USceneComponent* CollisionRoot;

private:

//Collsion Sphere Pointer
//USphereComponent* Collision;
UPROPERTY(EditAnywhere)
	UShapeComponent * Collision;

//CollisionFunction
UFUNCTION()
	void OnBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

};

and the cpp

ABullet::ABullet()

{

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


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

//initialise the static mesh
body = CreateDefaultSubobject<UStaticMeshComponent>("body");
//this->RootComponent = body;
body->AttachTo(CollisionRoot);


//part of collision detection
this->Collision = CreateDefaultSubobject<UBoxComponent>(TEXT("ObjectName"));
this->Collision->SetGenerateOverlapEvents(true);
this->Collision->SetWorldScale3D(FVector(1.f, 1.f, 1.f));
this->Collision->OnComponentBeginOverlap.AddDynamic(this, &ABullet::OnBeginOverlap);
this->Collision->AttachToComponent(this->CollisionRoot, FAttachmentTransformRules::SnapToTargetNotIncludingScale);

}

// Called when the game starts or when spawned
void ABullet::BeginPlay()
{
Super::BeginPlay();

}

// Called every frame
void ABullet::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);

}

//CollisionFunction
void ABullet::OnBeginOverlap(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{

if ((OtherActor != nullptr) && (OtherActor != this) && (OtherComp != nullptr))
{
	Destroy();
}

}

It may be overlapping static geometry in your level or with whoever is shooting the bullet (if you’re spawning it from other actor at it’s location) when you spawn it. You will have to check that OtherActor is not the actor who shot the bullet or make sure that you’re spawning it where is nothing to collide with. You should create a custom collision profile that filters anything that is not relevant for your actor collision too. You can do so in Project Settings → Collision and you can set the profile in your collider shape by using Collision->SetCollisionProfile(“your profile name”).

Cheers!

Not quite what I needed but, helped me figure it out. I forgot to change the world scale from something else. the box size was so big it overlapped the thing that was spawning it and destroyed itself.