After adding the
float UOpenDoor::GetTotalMassOfActorsOnPlate()
{
float TotalMass = 60.0f;
// Find all the overlapping actors
TArray<AActor*> OverlappingActors;
PressurePlate->GetOverlappingActors(OUT OverlappingActors);
for (const auto* Actor : OverlappingActors)
{
TotalMass += Actor->FindComponentByClass<UPrimitiveComponent>()->GetMass();
}
return TotalMass;
}
Unreal crashes when I hit play. I did go back to a previous sourcetree save and got back to this part to a crash again.
I also saw that Actor is undefined and assuming this is the issue?