So im getting an issue when just adding the event override node for a function in C++.
// h
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
void Shoot(FVector Start, FVector Direction, AActor* Self);
// cpp
void AGun::Shoot_Implementation(FVector Start, FVector Direction, AActor* Self)
{
if (!bIsShooting && bCanShootAgain)
{
FCollisionQueryParams CQP = FCollisionQueryParams(FName(TEXT("CQP")));
CQP.AddIgnoredActor(Self);
CQP.bTraceAsyncScene = true;
CQP.bTraceComplex = true;
FHitResult HitResult(ForceInit);
FVector End = Start + Direction * FiringDistance;
GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_Visibility, CQP);
if (HitResult.Actor != NULL)
{
APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(HitResult.GetActor());
if (PlayerCharacter != NULL)
{
DealDamage_Server(PlayerCharacter);
}
}
bIsShooting = true;
bCanShootAgain = false;
}
Shoot(Start, Direction, Self);
}
Then I add a node to override it and when I compile blueprint I get an error. No c++ errors. I think this is because before this, it was crashing due to not having the node and screwing up the binaries, but I cleared .vs, binaries, saved and intermediate and nothing. Any suggestions?
