[TUTORIAL] Fog Of War

I’m able to get it to work with multiple team based actors by selectively registering them with the FogOfWarManager. To get individual radius, inside of FogOfWarWorker I added the code below to the UpdateFowTexture() method which may not be the most efficient way but it works.



	for (auto Itr(Manager->FowActors.CreateIterator()); Itr; Itr++) {
		//Find actor position
		if(!*Itr) return;		
		FVector position = (*Itr)->GetActorLocation();

		// ----- START NEW CODE -----
		// Use sight radius from character attribute.
		ABaseCharacter* character = Cast<BaseCharacter>(*Itr);
		if (character)
		{
			sightTexels = (character->SightRadius / 100) * Manager->SamplesPerMeter; //Sight radius is in centimeters on character and the fow worker sightTexels expects meters.
		}
		// ----- END NEW CODE -----
...