# Foliage issues

**URL:** <https://forums.unrealengine.com/t/foliage-issues/482076>\
**Category:** World Creation\
**Tags:** foliage-paint, unreal-engine, Foliage, skeletalmesh, question\
**Created:** [April 17, 2021, 4:07pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076 "2021-04-17T16:07:12Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 17, 2021, 4:07pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/1 "2021-04-17T16:07:12Z")

</div>

I need to have foliage on a moving (animated) actor. Anyone have any thoughts on how to go about this? The foliage tool doesn’t work with skeletal meshes and I’ve tried to convert all instances to one static mesh object, but that doesn’t seem to work either.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 17, 2021, 4:24pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/2 "2021-04-17T16:24:13Z")

</div>

Foliage isn’t dynamic like that, I’m afraid…

If it’s a small amount of foliage, you can just put the actual meshes on the actor and attach them.

If it’s a larger amount of foliage, you need to write a blueprint to instance the foliage and attach it to the actor.

Then it will move with the actor.

PS: If you want to know how to make your own foliage spawner, it’s not that bad, I can explain, but I’ll need to see the mesh first 😉

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 17, 2021, 8:19pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/3 "2021-04-17T20:19:31Z")

</div>

If you could assist, that would be great. I’ve attached a pic of the mesh. It’s a crab, haha. I’ve spent so long on this, I might pull my hair out. It’s a pretty big amount of foliage I’m afraid. Lofty goals.

FOr a more indepth version of what I’m trying to do you can check out [Opus Monumenti | The Rookies](https://www.therookies.co/entries/9656)

 ![336206-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/4/794b81d5bfd2d5aab233d709177acb2c48f9ba68.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 17, 2021, 9:15pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/4 "2021-04-17T21:15:36Z")

</div>

Ok, it’s not pretty, but it works.

I made a spawning ‘plane’. It’s actually a flat box, because we’re not interested in the Z of the box.

 ![336238-screenshot-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/f/0cfc780e56428841a23d83c46c33cfaf9dc8a232.jpeg)

It runs a loop ( number given by that param ), does that many downward traces to find the target mesh ( also a param, see pic 1 ).

You can have an array of meshes, and it takes one randomly for each go. I only used one, just to make the point. Fifty grass meshes on the lion:

 ![336239-screenshot-4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/e/73edcdeed30e8af33da858652bb617e821272914.jpeg)

When you’re done, you can convert them to hierarchical instances meshes, by clicking on them and choosing ‘merge actors’. You have to click on them in the list, not the actual meshes. They all have the same name, so it’s easy:

 ![336240-screenshot-5.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/f/6bfac64a9077bb7a442ad095ffb487c106bee122.jpeg)

This option:

 ![336241-screenshot-6.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/a/41a5be2c76b4054a412a92d49b87c858225cab46.jpeg)

This is one ‘thing’ which you can attach to the target mesh and it will move with it etc.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 17, 2021, 9:22pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/5 "2021-04-17T21:22:11Z")

</div>

And the rest in another comment, because AH doesn’t work.

Here’s the code ( also attached as notepad )

 ![336209-screenshot-7.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/1/3/4134556216f9c8fe42bedbb4b6eeadeed4a399d4.jpeg)

[link text][1]

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 17, 2021, 9:24pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/6 "2021-04-17T21:24:33Z")

</div>

Tell me if I left anything out, because I got logged out about 5 times… :-/

I just tested it, the grass moves with the actor…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 17, 2021, 9:36pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/7 "2021-04-17T21:36:50Z")

</div>

If you also keep a record of the spawns, you can clear them too:

![336225-screenshot-8.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/2/6/b2671cc22086748b11eadc750f0887b4629d5209.jpeg)

 ![336226-screenshot-9.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/2/a52400180fe36014423bd4a943679428350241cc.jpeg)

![336227-clear.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/6/486f96b25f7fa4ae1f03a9c848d4b82f600adae2.gif)

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 17, 2021, 9:50pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/8 "2021-04-17T21:50:10Z")

</div>

Awesome! It works, but I’m not getting the same result. The only spawn in the box area and not on the mesh

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 17, 2021, 10:23pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/9 "2021-04-17T22:23:54Z")

</div>

Not sure what I’m doing wrong 😕 It’s set up exactly like yours.

 ![336251-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/2/4c2cdac6ad2eb8d2b70270d3b92328b4fdef6360.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2021, 8:48am UTC](https://forums.unrealengine.com/t/foliage-issues/482076/10 "2021-04-18T08:48:48Z")

</div>

Looking at your traces, I’d say you’re hitting the box. I have my box set to ‘overlap all’.

Also, this shouldn’t happen, because you’re checking that you’ve hit the target actor? 😉

Can you show your code anyway?..

PS: Also:

![336274-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/f/46fbb6072348b22396bd54a110bb0a2493f2a6bb.jpeg)

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 18, 2021, 2:01pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/11 "2021-04-18T14:01:17Z")

</div>

![336311-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/3/b537148134694d89bbedb6aad63145ea6b8b4ca6.jpeg)

 ![336260-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/2/1d233b6c7b5869bf25bc28b98f40345c3466d74e.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2021, 2:12pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/12 "2021-04-18T14:12:46Z")

</div>

Ah! - what is the collision on the crab?

I think maybe it has a huge simplex collision box. You probably need to set it to ‘use complex as simple’

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 18, 2021, 2:16pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/13 "2021-04-18T14:16:23Z")

</div>

It’s a skeletal mesh, is that an issue?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2021, 2:22pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/14 "2021-04-18T14:22:38Z")

</div>

What do you see when you look at the scene in collision mode?

Is the mesh still the same shape?

I think you have to set all the parts as ‘use complex’ in the physics mode.

 ![336279-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/e/fbe5e6567866063d1ccfc66f8248b039fbb91566.jpeg)

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 18, 2021, 2:41pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/15 "2021-04-18T14:41:38Z")

</div>

Ok, so yeah it’s the collision in the physics asset that’s the culprit. When I try to use complex collision as simple it doesn’t work however. If I re-generate bodies as convex hull it works though. Just not as accurate as the complex collision would.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [April 18, 2021, 2:48pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/16 "2021-04-18T14:48:00Z")

</div>

So, it’s kinda working?

---

<div class="post-metadata">

**Author:** ![jakebaker865](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jakebaker865](https://forums.unrealengine.com/u/jakebaker865)\
**Post date:** [April 18, 2021, 2:52pm UTC](https://forums.unrealengine.com/t/foliage-issues/482076/17 "2021-04-18T14:52:13Z")

</div>

Kinda, haha. I just have an issue where the physics mesh, if I set it to Use complex as simple, then there’s no collision. Just trying to figure that out now, but the core issue is solved.
