Hi, I'm working on a little test project (pretty much to get used to Unity 2D features) and started toying around with Line Renderer to dynamically generate a simple level. I'm trying to color the line segments based on the height/level/inclination, but I can't get it to work. Here is a screen of what I got : Here is what I want : I've been trying so far : To play with the LineRender.SetColors before setting the positions of specific points To use specific shaders for the LineRenderer I could not get it to work so I thought I could spawn prefab (with a 2 points LineRenderer) where I want the gradient, but I don't know how to do this efficiently (all this is done at runtime - before the level starts). Could someone give me an approach on this ? Thank you.
Please tell us more about this "could not get it to work", using minimal code snippets. I don't think that the Line Renderer mesh has enough data in it to get you what you want, but I'd like to see what you couldn't figure out in your shaders. SetColors is a useless method, in my opinion. Why do we have access to all nodes, but only the colors at the beginning and end?