Question by
DJFreshToast · May 21, 2017 at 03:27 AM ·
spritespriterendererlateupdate
Sprite changes only briefly?
I have a script that changes some SpriteRenderers' sprites on LateUpdate(), specifically after an animation stops. I'm doing so via:
gameObject.GetComponent<SpriteRenderer>().sprite = Resources.Load("pinkSquare", typeof(Sprite)) as Sprite;
When the code fires, I see the sprite change to a pink square, but only for an instant (maybe a frame?), then the gameobject immediately goes back to its original sprite. I searched through the entirety of my project for any other code blocks that use Update(), LateUpdate(), FixedUpdate(), and there's nothing else.
What might I be missing? I've been looking at this for hours.
Thanks!
Comment
After more searching, maybe this question is related?