Is there a way to transform instancedFoliageActor to a static mesh or BP?
Or either way, is there a way to foliage my landscape with StaticMesh/BP directly instead of InstancedFoliageActor?
I have a grass blueprint ( I need it to be a blueprint because I’m interacting with it).
So, as I can’t paint my landscape with blueprint directly ( is there a way to do that ? ) i’m painting foliage with the static mesh of my blueprint, resulting of lots of instancedFoliageActors on my map.
As I need it to be a blueprint, when i’m near one of my FoliageinstanceActor, I’m trying to delete this specific foliage element and spawing the BP at the same place allowing me to interact with it, but I really don’t find a way to interact with one specific foliage element.
My line trace return InstancedFoliageActor but can’t find a way to interact with it. If i remove this actor, it’s all the foliage that disappear
Can someone explain me a bit how I am supposed to do please i’m a bit lost, i must have the wrong approach here to do what i want.
UE used to support actor foliage, so you could paint your blueprint all over the place with the foliage tool. But, not recommended, especially if you’ve got a lot of grass.
The way most people approach this, is to use instanced foliage ( possibly scattered using your own tool, easy to do ), and when you do the trace, you swap out the mesh instance for your blueprint, so you can interact with it.
It actually does not work this way, i’ve tried it too.
The Hit item return just a number, the number of the foliage instance.
Look, here i’m printing the Hit item and the Hit component :
yes as in my capture, it give you the number of this instance yes. But how to you manipulate THIS specific instance ? Like removing it and getting its transform ? That’s my issue
Let’s say I make some foliage using 3 meshes. A cube, a pyramid and a sphere. There is still only one foliage actor ( always ), and it has 3 components ( the meshes ), and there are instances of those meshes.
There might be 200 cubes, 2 pyramids and one sphere.
The foliage actor sets up a cube ready for instancing, and creates 200 instances of it, same for the other shapes. You never see the instanced meshes, just the instances of them.
If you want more control over the process at some point, you might write your own mesh instancing process. Much easier than it sounds. Then you know what’s going on, and can have access to all the mesh locations and transforms up front, because you put them there…
I though I got it but the coordinates are really strange… if i compare to the coordinate of my tree fr example. The Z coordinate is… certainly not correct :