type name not allowed

i'm creating a line trace in ue4 and i'm trying to put damage on my line trace but i keep getting this error "type name not allowed" on my aai_character and my horde character


.cpp
void AHordeCharacter::OnFire()
{


FHitResult Hit;
FVector start = FP_Gun->GetForwardVector();
FVector End = start + (FP_Gun->GetForwardVector()* 700.f);
FCollisionQueryParams CollisionParams;
FVector Start = FP_Gun->GetComponentLocation();

DrawDebugLine(GetWorld(), Start, End, FColor::Green, true, 2.f, false, 4.f);

GetWorld()->LineTraceSingleByChannel(Hit, start, End, ECC_WorldDynamic, CollisionParams);

UGameplayStatics::ApplyDamage(AAI_Character///here, 6.f, false, AHordeCharacter///here, shot);

}
Use f'ing code tags when posting code!

If AAI_Character is a type name then why are you trying to pass it as an argument?
That's like passing int instead of 42.

AHordeCharacter is obviously a type name.
Maybe you mean this or possibly *this?

EDIT: Here's the prototype:
1
2
3
4
5
6
7
8
static float ApplyDamage
(
    AActor * DamagedActor,
    float BaseDamage,
    AController * EventInstigator,
    AActor * DamageCauser,
    TSubclassOf < class UDamageType > DamageTypeClass
)

So the first AActor is the one receiving damage and the second AActor is the one delivering the damage.
Your use of false doesn't really fit AController*, though. Maybe it should be nullptr (or just 0).
Last edited on
Topic archived. No new replies allowed.