I am using an Iterator to loop over all light components, like so:
for(TObjectIterator<ULightComponent> Light; Light; ++Light)
{
// ...
}
Now I want to cast the Iterator to a point light.
I tried it with something like this:
UPointLightComponent* PointLight = Cast<UPointLightComponent>(Light);
But that doesn’t work.
Any ideas how I can perform this cast correctly?