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.![alt text][1]
any help would be greatly appreciated I am very new to coding and need a lot of help.
[1]: /storage/temp/126466-untitled-1-zpsijsf8oge.gif
You might look at how people have made snake games. They do the same things you want: remember where they were, be a certain length, and know when they loop back and hit themselves.
Answer by DawidNorasDev · Oct 22, 2018 at 12:38 PM
I'm sorry to inform, but this gif is stationary :P 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.
Your answer
Follow this Question
Related Questions
Unity Trail Renderer acts ... differently on MAC 0 Answers
Sprite animation from parent gameobject, multiple sprites? 0 Answers
Produce water ripples from boat trail 0 Answers
error cant open any project 0 Answers
Trail renderer overlapping 0 Answers