# What is the best way to make Foliage interactable (aka. chop trees for resources like fortnite) with Multiplayer?

**URL:** <https://forums.unrealengine.com/t/what-is-the-best-way-to-make-foliage-interactable-aka-chop-trees-for-resources-like-fortnite-with-multiplayer/562658>\
**Category:** Multiplayer & Networking\
**Tags:** foliage-paint, unreal-engine, UE5-0, Multiplayer, question\
**Created:** [May 21, 2022, 11:36am UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-make-foliage-interactable-aka-chop-trees-for-resources-like-fortnite-with-multiplayer/562658 "2022-05-21T11:36:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![isikdev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/isikdev/32/991020_2.png) [@isikdev](https://forums.unrealengine.com/u/isikdev)\
**Post date:** [May 21, 2022, 1:07pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-make-foliage-interactable-aka-chop-trees-for-resources-like-fortnite-with-multiplayer/562658/2 "2022-05-21T13:07:59Z")

</div>

Hi, I’m not Fortnite dev but this is kinda a tricky task that I worked on and somewhat accomplished what I desired. I suggest you take a look at the hierarchical instanced static mesh component.

You should make a system where if the player tries to chop a tree, the instanced version gets replaced with the actor which is choppable. I will explain how I did mine. 🙂

So first, make your instanced component:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/9/5b97bc709d41521fda86b54451582afa35d68eab.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/d/ecdfe5b2c6ade4dc15962266fc8ac4aa8c8c639b.png)

Then head into your foliage types and set all your trees to use that component:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/0/600faf20c6030f2b9cb0a4aef34cde12d8b206c4.png)

Now for multiplayer, this way might not be the best to do this because I’m still learning networking logic however I got it to work as I wanted:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/1/2/c12dafeeb4fc0f45a0784c03659209ec54f67cf9.png)

Even though this works as I wanted it to, it probably won’t work as intended with clients that join a session late. For that I believe you must store the state changes in an array since every instanced foliage actor has the same ID on client and server (I believe).

I’ve found this thread which talks on that specific issue and how to handle it:

> [@Instanced Static Mesh replication issue](https://forums.unrealengine.com/t/instanced-static-mesh-replication-issue/33429/11):
>
> I got it to work!!! Here is my best explanation: I am using the procedural foliage generator from 4.8. I have the server store a non replicated array of hidden trees. You don’t need to know the state of all trees, just the hidden ones. I made a replicated BP called ResourceNodeHandler that has functions to help edit the Instanced Static Mesh from the procedural foliage generator. The array of “dead” trees is not replicated. When you hit a tree (run on server) add the dead tree’s instance ID …

Anyway, I hope this helps. Best of luck!

---

_[View the full topic](https://forums.unrealengine.com/t/what-is-the-best-way-to-make-foliage-interactable-aka-chop-trees-for-resources-like-fortnite-with-multiplayer/562658)._
