Is there a way to add behavior to foliage?

I’m working on making foliage that glows stronger whenever the player walks close to it and glow softer when he walks away, so far I made a blueprint with dynamic material instance that works for that behaviour put I can’t seem to find a way to make this work with foliage.
I’m adding some screenshots of my blueprint to see if they help out

ok to start your flip flops are not doing anything.

If i get your idea right your trying to increase the luminence of the leaves the closer the player gets and the reverse as they walk away and have it as a smooth transition. to accomplish this your going to need to compare the players location to the root of your tree actor then make that value drive the strength of your emission. timlines in this case would not be ideal since they are just fired and do their own thing. what you need is something that fires regularly at a set interval so either on tick or use a timer. I made up a quick script that should work in your case. It may not be 100% optimal since its been awhile since ive made something like this but hopefully it will help point you in the right direction.

In the script is use a box collision to turn on and off the tick event and to determine the bounds of when the transition should begin occurring. also instead of changing a material i was just using a point lights color for time and simplicities sake.

not exactly while I wanted the luminence to go up by a specific amount regardless of how close the player was, it’s more like giving the effect that the plant releases more light when it touches, my issue tho wasn’t getting it to work, it works just fine but it only does as a blueprint actor and I can’t seem to find a way to use it as foliage, since I want to fill a good chunk of the map with plants that light your way as way walk

P.D. I know the FlipFlop looks dumb that way but it makes the transition instantaneos without the need to wait for the previous timeline to finish, before I had to wait for the changes to the material finish to see the next change

oh in that case how about do the same thing essentially but have a collision volume on the character and at begin overlap with the tree get overlapping actors and set the material parameter from the character. so instead of the chracater moving into a box on a tree to fire the event, have when the tree overlaps the character the event fires.

Hmmm that might not work either. i got it to work from a on off point of view but every time there was a new overlap it would stop the timeline. i think you would need to be calling the timeline somewhere specific to the actor so either it would need to be an actor or it would need its own reference and script in the level bp. im thinking this problem may not be possible to solve yet

Did you manange to do it? I am wondering because I am also trying to do something like this

I did manage to do something that works, I ended up replacing the individual foliage actors on collision with blueprint including the static mesh that did what I wanted

I did it basing myself on this tutorial series

the problem as i see it now is that foliage is handled as a singular actor so its difficult to isolate just one tree for instance.