Register collision only if player moves faster than 1 km/h

This commit is contained in:
nsubiron 2017-06-19 11:52:45 +01:00
parent d4ad0070bd
commit f08a7d726a
1 changed files with 4 additions and 1 deletions

View File

@ -245,7 +245,10 @@ void ACarlaVehicleController::OnCollisionEvent(
FVector NormalImpulse,
const FHitResult& Hit)
{
CarlaPlayerState->RegisterCollision(Actor, OtherActor, NormalImpulse, Hit);
// Register collision only if we are moving faster than 1 km/h.
if (FMath::Abs(GetVehicleForwardSpeed()) > 1.0f) {
CarlaPlayerState->RegisterCollision(Actor, OtherActor, NormalImpulse, Hit);
}
}
// =============================================================================