So, I’m doing the First Person Shooter Tutorial in the learn section. In step 3.4: Getting Projectiles to Interact with the World, there is a line that won’t compile for me:
CollisionComponent->OnComponentHit.AddDynamic(this, &AFPSProjectile::OnHit);
The message log tells me this:
Compiling game modules for hot reload
Performing 2 actions (3 in parallel)
FPSProjectile.cpp
error C2664: 'void TBaseDynamicMulticastDelegate<FWeakObjectPtr,void,UPrimitiveComponent *,AActor *,UPrimitiveComponent *,FVector,const FHitResult &>::__Internal_AddDynamic<AFPSProjectile>(UserClass *,void (__cdecl AFPSProjectile::* )(UPrimitiveComponent *,AActor *,UPrimitiveComponent *,FVector,const FHitResult &),FName)': cannot convert argument 2 from 'void (__cdecl AFPSProjectile::* )(AActor *,UPrimitiveComponent *,FVector,const FHitResult &)' to 'void (__cdecl AFPSProjectile::* )(UPrimitiveComponent *,AActor *,UPrimitiveComponent *,FVector,const FHitResult &)'
with
[
UserClass=AFPSProjectile
]
note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ERROR: UBT ERROR: Failed to produce item: FPSProject\Binaries\Win64\UE4Editor-FPSProject-3409.dll
Total build time: 3,84 seconds