Hello everyone, I know almost nothing about foliage, but is it possible to remove a specific foliage tree using a line trace? How about spawning that tree back into the same place and adding it to the foliage instance?
Nope, not possible unfortunately. You have to spawn and remove this tree yourself. I think there are some feature requests about being able to place actors with the foliage tool, but who knows when this will be implemented. Until then you have to place the trees you want to interact with manually, or create your own random tree spawner.
Hmm… That’s painful ,I am working on an open world game, so that doesn’t seem very performance wise :\
I can’t find it right now, but there was an answer hub post that detailed destroying instances at least, it may be possible to destroy/swap an instance for a static mesh. Getting back to an instance, not sure. I’d ask Rama
You could make a tree that the player could chop down. Very easily in fact, just make it a destructible mesh that has a lot of chunks where the axe hits but no chunks anywhere else.
If you can get access to the instance reference, as well as the specific Integer for that instance, then yes you could. Without access to that info though, it won’t be possible.
Yeah removing the instance definitely should be doable since they are just an array of meshes so you need to target the object in the array. Spawning it back exactly the same would require finding out all the details about it and adding it back into the array. I haven’t done too much with the foliage tool but with instanced static meshes it would be possible.
Alright guys, I just made a working blueprint to do this, and it is awesome, I will post a tutorial very soon.
I will love you forever when you post the tutorial.
Until I post the tutorial, here is a quick demo GIF, in the demo, I placed a bunch of foliage (doors, but just pretend they are trees), and I can dynamically destroy the doors, I of course made mine destructible, but in the tutorial it will be slightly different, and I will demo trees as the foliage, I am hoping to have the tutorial up in a few hours.
http://i1285.photobucket.com/albums/a586/jamendx3/Untitled_zps57zo15kc.gif
Don’t do it! I claim this for the empire of Kodo sticks flag down
Update: I ran into a problem when you have more than 1 type of foliage mesh placed, I should have it fixed tomorrow. The tutorial will most likely be less than 30 minutes long, I only have like than 30 BP nodes placed.
Basically each type of foliage mesh you place has a range of instance indexes, for example: Tree_Pine covers indexes from 0-72, Tree_Maple covers indexes from 73-184, and Bush_1 covers indexes from 185-190, I am just working on a macro that will convert an index into the each respective mesh’s index, for example: index 5 would be index 5 in Tree_Pine, index 91 would be index 18 in Tree_Maple, and index 186 would be index 1 in Bush_1.
Until then, here is another GIF, this one has some trees:
http://i1285.photobucket.com/albums/a586/jamendx3/Cutting%20down%20Foliage_zpsnzwzgocc.gif
Edit: Got the bug fixed, this is now working flawlessly, I can interact with foliage the same as if it were any actor now, very excited to post the tutorial in the morning when I wake up.
That looks excellent man, definitely need you to do up a tutorial for people.
Also anyone interested, I have has several private tutoring sessions from Jamendxman3 and I have to say they have been so helpful, he has a great way of explaining things that are easy to understand and really fast at trouble shooting, I would suggest if anyone needs some one on one stuff get in contact with him. Highly recommended to increase your knowledge.
I am very impressed and highly interested in what this opens up.