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
asked Feb 02 '18 at 09:38 PM in Blueprint Scripting
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.
answered Feb 02 '18 at 11:46 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here