Looking to create a loop detection script.
Hello everyone. First time poster, so be nice!
I'm making a game with arrows on a grid. The arrow scene can rotate When instantiated on the grid. What I want to do is have a loop detected when the arrows create a continuous loop if followed along the grid from tail to head. I hope this makes sense!
Just looking for some tips and pointers of where to start. I think I somehow need to get the arrow to have some sort of directional marker that points along a grid in the direction of the arrow until it reaches another object. The script would check if that continues to another object etc etc until a loop is detected, then a separate function will trigger to handle what happens after the loop is detected.
Thanks for any help!