This can't be the best way. (array into material)

In prep for a challenge (small game jam) coming up, I’m shaking off the rust and came up with a puzzle.
How to make fog of war selectively part for enemy units.

It means getting the world coordinates of each of those units into a material, which … for the life of me seems like it should be simpler, but all I can come up with is using a series of material scalar parameters. (collection)

But seeing it, makes me cringe. This can’t be the best way to do this.

Does anyone know a simpler way to get owned vectors into a material/ (need to be able to turn them off selectively, such as when a unit is destroyed)

You want a little misty sphere around each tank?

The spheres are all added to create a map in worldspace where light can exist.
They are collectively the lerp between PostProcessInput0 and 0

The area near the center (camp) is exposed by a large sphere of its own, and a few fixed-location items are given some light-able space.

I need a way to get the world location of enemies in the fog and feed it to the material to allow them to be seen as well.
But this is the only way I’ve found to move that data into the material.

Where all those spheres are going…

Meh… see what you mean.

The only two things I can think of are:

  1. Material param collection? ( Not sure what you would do with that, but I think it’s a way to get coords in there.

  2. Better, do something with Niagra, because that you CAN manipulate with blueprint in the level.

Yeah, I need to learn Niagara, but I’ve been putting it off.
Parameter Collection is what I’m doing. Scalar, since the vectors are positive values only.
.
Now that I think of it… I could be sneaking negatives in by bumping the x and y by 10k each then reducing it by that much inside the material… that would reduce the number of nodes significantly.