Possible to clear a section of foliage during gameplay?

OK, wait. You’ve probably already figured this out or moved on, but I see why what I was recommending wouldn’t work… So first you have to get a reference to an InstancedFoliageActor, which is just represents the idea of “Somewhere there could be foliage in the world.” Once you have a reference to that InstancedFoliageActor, you have to iterate through its InstancedStaticMeshComponents array.

I guess one of you would know better than I would. Does a InstancedStaticMeshComponent represent a single kind of mesh that you put into the foliage tool? And then PerInstanceData represents the individual instances that you see in the game world? So because we’re working with a StaticMeshComponent and not a StaticMeshActor, it doesn’t have a convenient location. You have to figure out each instance’s location with InstancedStaticMeshComponent.PerInstanceData[n].Transform.

Maybe there’s a way to front-load that calculation–over many ticks if necessary–and load all the PerInstanceData into a Quadtree that you can use later to find all of the foliage (or at least the clusters) quickly and by location.

Probably individual instances can’t be hidden. Only the entire cluster can be hidden, or at least that’s how it works in game.

Perhaps the solution is to modify the cluster and remove the desired individual instance, as can be done in the editor. But how to do it with the game running, no idea.