Unreal Engine 4 - Place foliage at run-time
ฝัง
- เผยแพร่เมื่อ 2 ส.ค. 2024
- Just a brief tutorial showing you how you can place foliage at run-time in UE4. This method does work if you are using procedural foliage, but the component indexes still need to be consistent with the meshes in the foliage tab.
- เกม
First off, thanks for the great tutorials. Getting the index doesn't seem to work any longer in UE5. I have no idea why. Because I'm getting a completely different index as expected.
So what I did was in the Construction script, I listed all of the indexes and I could see which integer went with what bush/tree. I plan on making a nice UI just for the fun of it.
Now what if I wanted to "plant" a bush? Would it become an actor or maybe convert it to an instanced mesh?
This opens up a lot of possibilities like having a background timer that replaces the meshes or changes the size to "grow" plants.
could you do a tutorial on procedural foliage and how to respawn foliage after its gone please
for some reason the component index of the specific foliage type i'm looking for is -1 of what's returning from th eprint string. for example: print string returns 58, the actual index i'm looking for is 57
Don't forget to hook a wire from the Cast To instancedStsticMeshComponent to the Find. I had the same issue. :)
How does one respawn foliage once havested after a set timer?
Could you do a sphere overlap check instead of a trace? I wanted to have an AIActor look around itself for a tree to harvest.
Matt Marcin You can't do a sphere overlap, but you can do a sphere trace, which seems like it would work in your situation.
So i have two different trees, one gives more "logs" than the other, when my foliage spawns back it only spawns as one type
how do i fix this?
Around 14:45 you mentioned that you want to "save the data" and "re place the a foliage" to make it persistent -- are you implying writing our own serialize/deserialize methods? Or is there a way to make dynamic StaticMeshInstance components persistent on level save?
I'm sure you could link each instance up to a Struc of some sort containing all of it's transform data and just save an array of those strucs for it to construct on each load
Hello, this Tutorial is awesome! I have a question, how can u specify what foliage you want to spawn? Thank you so much!
Maybe I need to read the data table to select the trees, but I have to use a few days to solve this problem, I feels very difficult
cool cool but for the love of god stop doing this thing with your lips every 2 seconds