I am trying to create a check to see if a projectile has stopped moving and kill it, below is the basic idea:
void AProjectProjectile::TickActor(float DeltaTime, ELevelTick TickType, FActorTickFunction &ThisTickFunction) {
Super::TickActor(DeltaTime, TickType, ThisTickFunction);
FVector vel = this->GetVelocity();
if (vel.Size() == 0)
Destroy();
}
I did some debugging and noticed the velocity hovers around +/- 7 in size. Why do still objects stop and then retain a non-zero velocity and is this correctable?