access foliage instances during runtime?

Is it possible to access instances of foliage and grass during runtime? An example usage could be changing scale etc

This is possible if you use something like a trace and hit the foliage actor you can get the actor and the hit foliage index then you get the instance from the actor with that index and you can edit that instances variables.

Check this: http://blueprintue.com/blueprint/347jlkf6/
on Get all actors of class, select “Instanced Foliage Actor”

Thanks DjSt3rios, but it seems to always fail.

Edit, sorry I see it is working for regular foliage but not grass, thanks I will have a fiddle around with this :slight_smile: much appreciated for quick response and help.

After some fiddling, everything works, but still no grass, any suggestions on getting grass foliage

1 Like

on “Get Child Component”, change the index from 0 to 1, or 2, what I did was to read all of the children to find the correct IDs :slight_smile:

This only works for painted foliage, but I am also trying to get it to work with the material landscape grass node without success. The type seems to be "FoliageType_InstancedStaticMesh, but since it is not considered an actor class, it can’t be selected.

I am a bit confused with what you are trying to achieve. How do you place the grass in the world?

I am using the LandscapeGrassOutput node inside my material, in reality what I would like to do is occasionally grab the grass instances, update colour and scale based on the age of the grass.

Aaron’s system does exactly this, i use it to change my grass color and scale throughout the year, it works with the LandscapeGrassOutput
https://forums.unrealengine.com/showthread.php?97253-FREE-Advanced-Cinematic-Grass-Blueprint-with-3D-Imposter-Sprite-foliage

Thanks ixicalibur, I will check out his blueprints.