-1

I want to calculate the force of the collision. For example, the car is on the bridge, and I want to find pressure force. In the second case, I have a falling car, and I want to find the force of the impact. Are there any functions for this?

I want to use c ++.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
mksmptrnk
  • 13
  • 1
  • 6

1 Answers1

0

All you do is multiply the Mass and the Speed together

void AMyActor::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
   float HitForce = OtherActor->GetVelocity.Size() * OtherComp->GetMass();
   UE_LOG(LogTemp, Warning, TEXT(HitForce));
}

HitForce is the variable you're looking for.