I don't know how to make a following trail of data points

I am trying to make a system where when the player moves there is a string of data points similar to a trail, and once the trail hits a certain threshold the trail stops getting longer and stays the same length. I also need a function where if the trail ever crosses itself and creates an enclosed shape the interior of the shape changes colors. the image below is a good representation of what i am attempting to create with the player at the spearhead of the line.126466-untitled-1-zpsijsf8oge.png

any help would be greatly appreciated I am very new to coding and need a lot of help.

I’m sorry to inform, but this gif is stationary :stuck_out_tongue:
What I recommend is using a TrailRenderer for the trial, unfortunetly, you would have to check for intersection yourself. TrialRenderer will give you points and lines of the trail, The work will be to write/find an algoritm which checks for intersections and fills the inside.