Interactive Foliage Actor Issue

Hello,

Is the interactive foliage actor still a UE4 work in progress?

I have a static tree mesh which I am trying to bump around with the default character, these are the steps I’m taking to create the interactive foliage actor:

1 - Drag the static mesh into the world (it has a collision mesh and collision enabled).
2 - Down in the Actor section of Details, I use the convert dropdown and select ‘InteractiveFoliageActor’
** At this point the static mesh is replaced with a capsule and the geometry is shifted to another position. I can’t move the mesh representation.**
3 - I create a material that tries to mimic an old UE3 UDK tutorial for the interactive foliage actor.

http://udn.epicgames.com/Three/InteractiveFoliageActor.html

My material looks like this. I didn’t find all the same nodes as in the UDK tutorial, so I improvised:

The tree doesn’t budge as i move onto it or fire projectiles. Any ideas?

You can use this tutorial from epic games:- YouTube in the Radius you chance the WorldPosition.

Looks promising, I’ll try it out when I get home, thanks!

So, I still have an issue with using the interactive foliage actor’s simulation, but first I’ll describe what I achieved in a fashion similar to the tutorial you posted. Maybe it’ll help someone:

I was able to use a blueprint that rotates the tree when i get close to it.
1 - Add an absolute world position as input, connect to RotateAboutAxis (RAA) position.
2 - 0,0,0 constant vector as pivot (it’s relative to position) to RAA’s pivot point.
3 - A function that rapidly gets bigger as character approaches (max clamped) to the RAA’s rotation angle, which takes player’s position as input (see Material Parameter Collections for how to do this).
4 - RAA’s Rotation axis just needs a normalized vector that is orthogonal to the player to actor and actor up vectors.

BUT, this isn’t the same as using the interactive foliage actor’s simulation code to push the tree with the character. So i’m still stuck. Here’s the latest progress on that front:
I put print to viewport statements in the Tick and CapsuleTouched functions implemented for InteractiveFoliageActor and can see capsule touched events being fired when I enter the tree’s capsule component.

I also printed the vector describing FoliageVelocity and FoliagePosition at every Tick; these vectors are oscillating until they reach a small value, at which point the simulation shuts off ticking for this actor.

This is all great, but the interactive foliage actor’s static mesh representation is not reflecting the oscillating values I see being printed.

There is a function that “propogates the new rotation axis and angle to the rendering thread” called UpdateParameters_GameThread. I bet there is a way to pick up the rotation axis and angle value from the blueprint and use it in the material to control world position offset, but I haven’t figured out how to tap into these values. The code has a GetFoliageParameters function which outputs impulse direction and normalized rotation axis and angle (these are what I need in my blueprint, but can’t get to them). Any ideas?

Code is in Source/Runtime/Engine/Private/FoliageComponent.cpp

Have a look at the new pivot painter map in the Content Examples that came with 4.2. There you find a setup for bending grass based on the player location.

That blueprint looks pretty similar to the solution I already found for bending the tree. What I’m looking for is a spring-like oscillating effect that the InteractiveFoliageActor is intended to create. See this video from UE3’s version:

and here:

Hey TheUtahTeapot,
I’m looking to do the same thing, have you made any progress on this?

Yes, see my post in the answerhub. I describe a hack/workaround in the question and my comment, but I worked on another part of my project in the meantime so I haven’t found/created a cleaner solution.

https://answers.unrealengine.com/questions/59562/is-the-interactive-foliage-actor-still-a-ue4-work.html

today i create a Interactive Foliage material, maybe its helpfull :slight_smile: