I think Intellisense is broken with Range 'for' loops and UPrimitiveComponent

When getting the actors in the trigger and adding up their Mass…
It compiles and runs correctly.

It still red underlines “OverlappingActors” in the range ‘for’ and gives this error.
this range-based ‘for’ statement requires a suitable “begin” function and none was found

It still red underlines “UPrimitiveComponent” for finding the component and gives this error.
type name not allowed

I tried lots of searching and Google didn’t even recognize the error.
I tried restarting.

float UOpenDoor::GetPressurePlateSum()
{

	float PressurePlateSum = 0.0f;

	//get the list of all actors triggering the plate
	TArray<AActor*> OverlappingActors;
	PressurePlate->GetOverlappingActors(OverlappingActors);


	for (const auto* Actor : OverlappingActors)
	{
		PressurePlateSum += Actor->FindComponentByClass<UPrimitiveComponent>()->GetMass();
		//UE_LOG(LogTemp, Warning, TEXT("Object weighed: %s"), *(Actor->GetName()))
	}

	return PressurePlateSum;
}
1 Like

After nuking all temporary files and rebuilding them from scratch, VS is no longer posting those “errors”. IDE errors are terrible.

1 Like