x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

alt text

alt text

Product Version: UE 4.17
Tags:
capture.jpg (152.1 kB)
capture1.jpg (147.4 kB)
more ▼

asked Feb 02 '18 at 09:38 PM in Blueprint Scripting

avatar image

WeirdFrank
1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

alt text

capture.png (284.1 kB)
more ▼

answered Feb 02 '18 at 11:46 PM

avatar image

ThompsonN13
10.1k 33 9 23

avatar image WeirdFrank Feb 03 '18 at 12:05 AM

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

avatar image ThompsonN13 Feb 03 '18 at 12:15 AM

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.

avatar image ThompsonN13 Feb 03 '18 at 12:26 AM

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

avatar image GrievousOrder66 Apr 03 '18 at 11:31 AM

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

avatar image WeirdFrank Apr 03 '18 at 05:55 PM

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

avatar image ThompsonN13 Apr 03 '18 at 10:41 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question