# Incorrect foliage color in the editor preview when using PerInstanceRandom in foliage material

**URL:** <https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994>\
**Category:** Rendering\
**Tags:** unreal-engine, Foliage, bug-report, editor, UE4, question\
**Created:** [March 16, 2018, 10:50am UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994 "2018-03-16T10:50:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekB0B0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@geekB0B0](https://forums.unrealengine.com/u/geekB0B0)\
**Post date:** [March 16, 2018, 10:50am UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/1 "2018-03-16T10:50:55Z")

</div>

When using PerInstanceRandom in the foliage material the foliage in the editor preview has incorrect “broken” color. In the game preview all works fine.

**STR:**

1. Create new blank project.
2. Create new material.
3. In the material editor add vector3 node and change its colour (yellow for example).
4. Add PerInstanceRandom node.
5. Add “Add” node.
6. Connect vector3 and PerInstanceRandom to Add node.
7. Connect add node to Base Color or/and Emissive Color.

 ![233972-image-10.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/1/381098bb31266c2d9ee7927ed517fc007cc5f755.png)

1. Apply changes and save material.
2. Create new static mesh and set new material in material slots.
3. Add new static mesh to foliage brush.
4. Place foliage on level.
5. Save and reopen level.

**Result:**  
Foliage color is broken.

 ![233973-image-8.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/7/eb72e907b43bb97246c6bcb342f32e17f2fc6df4.jpeg)

**Expected Result:**

 ![233974-image-9.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/1/0b1c4df41d181dd3d9715ebdb3a0f9afc79ce711.jpeg)

Additional Info:  
In the 4.18.x all works fine.

---

<div class="post-metadata">

**Author:** ![Jeff\_A](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jeff\_A](https://forums.unrealengine.com/u/Jeff_A)\
**Post date:** [March 16, 2018, 8:09pm UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/2 "2018-03-16T20:09:32Z")

</div>

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

[https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form](https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form)

Thanks

---

<div class="post-metadata">

**Author:** ![geekB0B0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@geekB0B0](https://forums.unrealengine.com/u/geekB0B0)\
**Post date:** [March 20, 2018, 11:03am UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/3 "2018-03-20T11:03:47Z")

</div>

Hi, thank you!

I submitted an issue report using the new Bug Submission Form, I will update this thread if some feedback comes back.

---

<div class="post-metadata">

**Author:** ![Draxus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Draxus](https://forums.unrealengine.com/u/Draxus)\
**Post date:** [March 21, 2018, 6:28pm UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/4 "2018-03-21T18:28:01Z")

</div>

I’m also experiencing this issue in 4.19 and was able to reproduce it in a new blank project. Here is the bug report to vote on for anyone else having trouble. [Unreal Engine Issues and Bug Tracker (UE-56272)](https://issues.unrealengine.com/issue/UE-56272)

---

<div class="post-metadata">

**Author:** ![Accel\_Sjostrom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Accel\_Sjostrom](https://forums.unrealengine.com/u/Accel_Sjostrom)\
**Post date:** [April 10, 2018, 3:39pm UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/5 "2018-04-10T15:39:06Z")

</div>

I have the same issue. Very annoying, but at least the correct colors are being displayed when actually running the game.

---

<div class="post-metadata">

**Author:** ![geekB0B0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@geekB0B0](https://forums.unrealengine.com/u/geekB0B0)\
**Post date:** [May 2, 2018, 2:27pm UTC](https://forums.unrealengine.com/t/incorrect-foliage-color-in-the-editor-preview-when-using-perinstancerandom-in-foliage-material/419994/6 "2018-05-02T14:27:10Z")

</div>

Fixed in 4.19.2
