Check out example codes for "how to use line renderer moving camera unity". It will help you in understanding the concepts better.

Code Example 1

You simply have to update the points in Update to new world positions each update (and not just when you create the curve).

Something along:

int i = 0;


foreach screenPosition of my curve
   Vector3 worldPosition = camera.ScreenToWorldPoint(screenPosition); 
   lineRenderer.SetPosition(i, worldPosition);
   i++;

The tricky part will be to update if you interpolate screenpositions (or worldPositions), or sample them. In either case, the slow but easy method will be to re-interpolate and resample each Update.

Once you have got this going, you can optimise by storing the the right number of points in screen space. Then you only have to convert to world space - no need to resample or reinterpolate.

Learn ReactJs, React Native from akashmittal.com