UE crashed when I init the TArray

There should be something obvious, but I just couldn’t find it. Thanks for your help.

float UOpenDoor::GetTotalActorsMassOnPlate() {
	float TotalMass = 0.f;
	//Find what's on the pressure plate
	TArray <AActor*> OverlappingActors;
	PressurePlate->GetOverlappingActors(OUT OverlappingActors);
	//iterate actors on plate to get the total mass
	for (int32 Index = 0; Index != 3; ++Index)
	{
		//TotalMass += OverlappingActors[Index]->FindComponentByClass<UPrimitiveComponent>()->GetMass();
		//UE_LOG(LogTemp, Warning, TEXT("%s on pressure plate"), *OverlappingActors[Index]->GetName());
		TotalMass += 16.f;
	}
	return TotalMass;
}

Problem solved. It because I’ve added openDoor component to static actor. Please Ignore this stupid problem.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms