I ran into a really basic issue that almost nobody seems to have a solid explanation for; I want to change the sprite of my gameObject based in a script I made in Javascript, but the only code I can find that someone says does that is:
var newSprite : Sprite;
function Start () {
GetComponent(SpriteRenderer).sprite = newSprite;
}
But obviously I want to reference the “walk1” sprite from my assets, so where would that go?
In “var newSprite : Sprite;” would my image go where “Sprite” is, & how would I go about writing that?
I’m sorry, I’m a noob >.> any help would be greatly appreciated.