- Home /
Progressively Drawing a line along a path
Hey CommUnity!
I've got a unique situation. I haven't found anything related through searching, and I'm not entirely sure what to search for.
I've got a player in a 2D game. When you make contact with a collider surface (walking on the ground, bumping into a wall, hitting the ceiling, etc.) I'd like to draw a line from the point of contact outwards along the collider edge. This line shouldn't extend very far from the point of contact, and it will not reset. So if you walked from one point to another point, you'd see the path you just walked (see my fantastic image below :) ).
I'm not sure what this would entail, but here's some thoughts I had:
Have a pre-made path separate from the collider. When player intersects this path, begin to render it from the point of contact in both directions for a very short distance.
Create a custom shader
If it's not clear what I'm trying to do, let me know! It's tricky to explain.
Thank you!
Clopay