I’m making a 2D game where characters can move in 8 directions, and I want to change the image of a sprite based on which direction it’s moving (think “Link to the Past”). I had been using:
SpriteRenderer spriteRenderer =
GetComponent ();
But, making a getcomponent call for each change of direction will really affect performance, especially when there are dozens of sprites to update at once. Is there a better way to change image? Can I access the spriterenderer in start and then rotate through them when direction changes?