在ue4中 蓝图里的碰撞检测是一个事件,在ue4 c++中 需要先写一个函数
函数签名如下
void OnHit(class UPrimitiveComponent* OverLapComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult);
具体在头文件中实现的话必须加上UFUNCTION()
UFUNCTION()
void OnHit(class UPrimitiveComponent* OverLapComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResu