The following deprecated function works fine ingame:
UGameplayStatics::PlaySoundAttached(DamageType->DamageSound, FirstPersonCameraComponent,NAME_None,FVector(5,0,0));
the newer one that gives compile error:
UGameplayStatics::SpawnSoundAttached(DamageType->DamageSound, FirstPersonCameraComponent, NAME_None, FVector(5,0,0));
compile error:
error C2668: 'UGameplayStatics::SpawnSoundAttached': ambiguous call to overloaded function
note: could be 'UAudioComponent *UGameplayStatics::SpawnSoundAttached(USoundBase *,USceneComponent *,FName,FVector,EAttachLocation::Type,bool,float,float,float,USoundAttenuation *,USoundConcurrency *)'
or
'UAudioComponent *UGameplayStatics::SpawnSoundAttached(USoundBase *,USceneComponent *,FName,FVector,FRotator,EAttachLocation::Type,bool,float,float,float,USoundAttenuation *,USoundConcurrency *)'
CompilerResultsLog:Error: Error x : note: while trying to match the argument list '(USoundCue *, UCameraComponent *, EName, FVector)'
the vector offset is important but gives compile error, all other arguments are unneeded for me.