Random Color on Foliage

Hello everybody :slight_smile:

I’ve created a material which changes the color depending on the world position, but it doesn’t work on foliage, only on static meshes placed in the world by hand. How would I get this to work on foliage? Here’s my current material set up

PerInstanceRandom is what you’re looking for.

Yep, this fixed it. Thanks :smiley:

If you ever need object position that works with foliage instances too. Try to transform zero vector(0,0,0) from local space to world space. Be careful this only work at vertex shader. So remember to use Vertex Interpolator node if you need this at pixel shader.