I'm a total beginner and I need to make a ball roll around on a flat surface and have it leave a trail/tracks of where it has travelled without it disappearing over time. Is there a function or method that I can use to create this effect?
Have you checked out using the Line Renderer component? I'm thinking you could use a track or trail texture, apply a material of that texture to the line renderer and voila! instant tracks without any sort of coding ;)
Here's a link to the Line Renderer page on Unity's Reference Manual: Link
Personally though, there is no specific function or method to solely handle "leaving tracks". However, this is still possible with code (and might be more appropriate in your case). If the Line Renderer doesn't work out for you, do tell so we could try 'coding' it instead.
You can create a Mesh procedurally and record the trail of the object with the dynamically updated mesh. If this is going to grow very long you probably want to build the trail in segments, and only dynamically update the leading segment, just behind the ball. This will take some non-beginner level scripting though, so if you can get the TrailRenderer working for you that would be easiest.
One potential downside of LineRenderer/TrailRenderer is they orient towards the camera, which may or may not be desirable, depending on the look you want. They work well for glowing translucent trails, as in @Statement's nice screenshot.
Someone just pointed out this link to me -- Starscene Software has a utility called "Vectrosity" which renders lines be converting them to meshes. Looks like just what you need.
