# Unity move arrows along path

I am not sure how to go about what might be a simple task. I want directional arrow sprites to move along a curved path in 2d to show the player when to go.

I can use DoTween to create a path. But not sure if I should Instantiate a load of sprites(arrow) and move them along. Its seems wasteful.

• Did you consider doing this with a LineRenderer and a scrolling tiling texture? – DMGregory Sep 15 '19 at 0:35
• Not I didn't actually. I looked it up and I don't see any examples unfortunately. – Keith Power Sep 15 '19 at 1:04
• Thank you @DMGregory for that suggestion. I did more research and was able to get this working. If you want to add your suggestion as an answer I would be happy to mark it as the correct one. – Keith Power Sep 15 '19 at 10:37
• If you have a working solution to your problem, then you'd be in an even better position to write it up as an answer — with screenshots and details of how you set it up to serve your needs. It's 100% OK to answer your own questions here. :) – DMGregory Sep 15 '19 at 11:31
• I think it would be great if you added your own answer to this question, I could learn from it ;) – Millard Sep 15 '19 at 19:33

Here is the following code I added to the LineRenderer to scroll the tiles texture.

public class LineArrow : MonoBehaviour
{
public float scrollSpeed = 1f;
public Renderer _renderer;
// Start is called before the first frame update
void Start()
{
_renderer = GetComponent<LineRenderer>();
}

// Update is called once per frame
void Update()
{
float vOffset = Time.time * scrollSpeed;
_renderer.material.SetTextureOffset("_MainTex", new Vector2(vOffset, 0));
}
}