Hey
Looking for some starting advice / potential existing solutions for this problem.
I’m trying to trace a line that follows the users controlled object position, from a start point - like tracing a trail behind pac man for example from the start point. What I’m stuck on is if the player decides to change direction and move back on itself - what would be the best way to update the line renderer so that you start to delete the most recently drawn points rather than keep adding new ones?
I want to only draw the line that traces the players movement route but only to the player and never beyond if they reverse and go back where they came.
A good example I found was the puzzle ui in ‘The Witness’ which does essentially the same thing - if you back track/reverse, it doesnt add more line to show that reversal, it just removes the paths you’re undoing, only drawing the route between the start point and the object.
Suggestions much appreciated!
Edit: thinking out loud:
Would I draw lines between junction points, and then the most recently passed junction to the player? So only the line between the player and the most recently point is ‘live’ and can be undone?