Move/Animate Foliage

Hello guys,

I’ve been working on a 3D side scroller the past few weeks and I would like to populate the background environment with trees.

The camera is fixed and the environment translates from right to left to give a sense of movement.
Once it reaches a certain distance, it loops back to its original position and translates to the left again ( the same way Tappy chicken works).

I used the foliage tools to fill the scene rather that doing it one tree after another but I can’t find a way to animate the foliage so it matches the translation of the ground.

I guess I’m trying to reference the foliage and add a AddRelativeLocation node to it to make it move.
I tried all the “instanced” type variables without success and I’m not quiet sure to understand what the foliage blueprints are used for.

If someone could help me understanding how it works it will be great.

Thanks in advance

Olivier

PS: attached the different nodes I tried to used

You can reference that landscape itself to move it, when the landscape moves the foliage moves with it…not sure how your “ground” is setup that the player moves on though so that may not work for you if you are also using the same landscape for the player to move along…or you can create a sublevel with a separate landscape and still have it move with the foliage on it.

Hi Black Phoenyx,

thanks for your answer.
The “ground” is a mesh referenced in a “GameBlueprint” where I have all the components (camera, environment, etc…).So in order to create the foliage I need a copy in the scene of the mesh referenced in the blueprint and then paint the foliage on it.
I tried to animate the mesh that I created the foliage on and the foliage follows the mesh if you move it in the viewport, however if you animate this mesh and press play the foliage won’t follow.
Hope I’m clear

Oh ok, also just reread that you are painting…I misread that before…the painted foliage won’t allow you to set its mobility…it will remain static in the scene because the root component it set to static and not moveable. You could setup a blueprint to generate a random arrangement for foliage that isn’t painted and then you could add to its location and the ground. Like this:

Then the added offset (here I added it in the level BP but it can really be done from anywhere):

Here is a video so you can see it in action it can all be tweeked to your needs of course this is just an example:

Thanks again BlackPhoenyx,

the problem with this techniques is that you don’t really control where to place your trees and what I don’t understand is why in the instance settings of the foliage Source Asset Type I can setup the mobility to Movable but not dynamically make it translate.

Might have to place those trees individually I guess.

When you paint the foliage it all becomes a single actor in the level and that actor has a preset mobility setting of static with no way to edit it. I thought maybe that method would help but if you need them in very specific places then you may have to add them individually.

Ok I see. Thanks again for your answers.