首页 > 解决方案 > 车辆和箱子碰撞之间的重叠不起作用ue4

问题描述

void ARasenmaeher::OnBeginOverlap(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
    if (OtherActor->ActorHasTag("BoxCollision"))
    {
        UE_LOG(LogTemp, Warning, TEXT("Overlap"));
        IsOverlapping = true;
        while (IsOverlapping == true)
        {
            AngryLevel += 10;
        }

    }
}

盒子碰撞设置为overlapalldynamic,车辆设置为“Vehicle”,我怎样才能让重叠事件起作用?

标签: c++unreal-engine4

解决方案


推荐阅读