// gets total KG of things on plate
float UDoorOpenClose::GetTotalMassOfActorOnPlate()
{
float TotalMass = 0.0f;
// finds all overlapping actors
TArray<AActor*> OverlappingActors;
TriggerVolume->GetOverlappingActors(OUT OverlappingActors);
// Iterate through them add their mass
for (const auto* Actor : OverlappingActors)
{
TotalMass += Actor->FindComponentByClass<UPrimitiveComponent>()->GetMass();
UE_LOG(LogTemp, Warning, TEXT("on pressure plate"));
}
return TotalMass;
}