"GetOverlappingComponents()" instead of "GetOverlapingActors()"

A slightly different approach to getting a mass of Actors. Seems to work just as well.

    float TotalMass = 0.f;

	TArray<UPrimitiveComponent*> OverlapingComponents;
	PressurePlate->GetOverlappingComponents(OUT OverlapingComponents);

	for (UPrimitiveComponent* PrimitiveComponent : OverlapingComponents)
	{
		TotalMass += PrimitiveComponent->GetMass();
	}
2 Likes

Great job experimenting! :clap:

1 Like

Privacy & Terms