728x90 반응형 언리얼 일인칭 게임 개발1 [UnrealEngine5] 충돌했을 때 반응하는 오브젝트 만들기 C++ void ABullet::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComponent, FVector NormalImpulse, const FHitResult& Hit) { if (OtherActor != this && OtherComponent->IsSimulatingPhysics()) { OtherComponent->AddImpulseAtLocation(bulletMeshComp->Velocity * 100.0f, Hit.ImpactPoint); } //닿으면 밀려나고 충돌한 물체는 사라진다 Destroy(); } 충돌했다 라고 하는건 OnBeginOverlap도 사용할 수 있지만 OnHi.. 2023. 7. 21. 이전 1 다음 728x90 반응형