# BP\_How can I get a static result after MultiLine trace by Channel?

**URL:** <https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [July 15, 2022, 2:04pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621 "2022-07-15T14:04:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zickzeon0080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zickzeon0080](https://forums.unrealengine.com/u/zickzeon0080)\
**Post date:** [July 15, 2022, 2:04pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/1 "2022-07-15T14:04:05Z")

</div>

Morning morning the almighty community!  
I tried to build a customized scatter that can generate static mesh/foliage on mesh.  
Basically I just followed this tutorial by Harry from the Antler Studios

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/1/551d5bcea2aef1bf7034ab0bb7e83f5a8c563c40.jpeg "UE4: Foliage Generator") ](https://www.youtube.com/watch?v=E9pH8WyyAm0)

Also followed this one to learn how to get some randomization.

> **[UE4 Custom Scatterer – SOA Academy](https://www.stateofartacademy.com/ue4-custom-scatterer/)**

My question is, how can I get a static result after multiline trace by channel is done? I’m using break hit result to extract from the hit calculation then added some params to create some random on rotation and scale. But for now whenever I adjust ANY parameters, the multiline trace will re-calculate. Am I doing anything wrong with it? Is it possible for me to rotate/scale those mesh instance on each local axis?

 ![BP_01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/8/2081e637bf36331f48e3cdf8f447ec721daf289f.png)  
 ![BP_02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/2/3d26660629593025c0ba9fc1631e36499306e3e3.png)  
 ![BP_04](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/7/7575d22c489321bade2ef9bff3deee38715a61c7.png)  
 ![BP_03](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/6/456f30138203312a641445d240d75ac0abed75bb.png)

Thank you for your help in advance!

---

<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:** [July 15, 2022, 2:32pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/2 "2022-07-15T14:32:44Z")

</div>

That’s what a construction script does, it re-runs the whole thing, every time you change anything.

You can tweak instances after placing with update instance transform, where an integer refers to the instance

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/3/fa35be199889f14e9b4019882bc12c10f64ba6df.png)

---

<div class="post-metadata">

**Author:** ![zickzeon0080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zickzeon0080](https://forums.unrealengine.com/u/zickzeon0080)\
**Post date:** [July 15, 2022, 2:42pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/3 "2022-07-15T14:42:23Z")

</div>

Thank you so much my hero!!  
Just let you know I’m still very new to the BP system and I’m terribly sorry but do you mind to explain a bit of it please? What does this integer do? How can I set the correct number of it? Should I connect the random rotate/scale to the New Instance Transform?

Sorry if I ask too many questions lol

---

<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:** [July 15, 2022, 3:25pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/5 "2022-07-15T15:25:23Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/d/1bdda10426c70eb8c7d565a2d22b4632a82cc6c6.png)

So this will rerun the construction even when you want to change the transform of an instance. I think that’s unavoidable. But, you can use the construction to make the instances, and change their transform at runtime, no problem…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/a/f6aaaeae8f00ff48d51f5b497670ba0340562159.png)

![instancetransform](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/1/aa191e02ed2f800c8dacad037060978cb7bfa290.gif)

---

<div class="post-metadata">

**Author:** ![zickzeon0080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zickzeon0080](https://forums.unrealengine.com/u/zickzeon0080)\
**Post date:** [July 15, 2022, 8:04pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/6 "2022-07-15T20:04:56Z")

</div>

Hey ClockworkOcean,

Thank you so much for teaching! Sorry for the late reply I just got time to take a breathe.  
Can you take a look at my BP please? They still changing position all over the bounding area.

 ![BP_05](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/6/d86e476a1c9dc9b642cdfed1ac026852856ab9b9.png)

For now I’m just trying to mimic the basic function of foliage grows on LandscapeLayers. Need a static forest just for render.

 ![BP_06.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/f/bff6391b544ade890058ff1d70c68e19d62e8168.jpeg)

So basically I’m trying to achieve generate static mesh on the surface of another large terrain mesh. Is there a better solution than using a Multiple Line Trace? Is that the reason why it kept changing location?

---

<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:** [July 15, 2022, 8:15pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/7 "2022-07-15T20:15:35Z")

</div>

You haven’t done anything wrong. But if you’ve used ‘random point in bounding box’, the trees will jump around every time you change parameters. It’s because the whole script runs every time, nothing you can do about it.

So, you might as well, just add rotation as you’re making the instance. I think the stuff with specifying the instance index is to do with making changes at runtime. For example, you could make the trees rotate, which you probably wouldn’t want to do 🙂 ( that’s what I’m doing above ).

---

<div class="post-metadata">

**Author:** ![zickzeon0080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zickzeon0080](https://forums.unrealengine.com/u/zickzeon0080)\
**Post date:** [July 15, 2022, 8:31pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/8 "2022-07-15T20:31:42Z")

</div>

Thank you so much for your kind and patience!! I’m really appreciated that!  
BP is like a mystery for me with no doubt.  
lol mind if I ask one last question please? Do you have any recommendation tutorial or docs that I can take a look at how to generate static mesh on selection mesh surface or control it by a mask please?

---

<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:** [July 15, 2022, 8:57pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/9 "2022-07-15T20:57:26Z")

</div>

You can put the texture in a render target, and read it like this

> [@Reading texture color data using UV values](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/13):
>
> He reached out! Thanks. I ended up moving away from reading color coordinates and just storing values into an array.

It’s quite obscure, so no tuut. Most people would do it with the landscape actor 🙂

---

<div class="post-metadata">

**Author:** ![zickzeon0080](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zickzeon0080](https://forums.unrealengine.com/u/zickzeon0080)\
**Post date:** [July 15, 2022, 10:51pm UTC](https://forums.unrealengine.com/t/bp-how-can-i-get-a-static-result-after-multiline-trace-by-channel/605621/10 "2022-07-15T22:51:04Z")

</div>

Thank you thank you!!!  
Have a great weekend!
