Trouble getting created sprite to set.
I'm currently running a test where I want to take a Texture2D, convert it to a sprite, and set the sprite as the source image of an Image. However when I hit play the image remains blank.
 public GameObject guess;
 private Image Pic;
 public Texture2D test;
 void Start(){
     Image Pic = guess.GetComponentInChildren<Image>();
     Rect r = Pic.rectTransform.rect;
     Debug.Log(r);
     Vector2 piv = Pic.rectTransform.pivot;
     Pic.sprite = Sprite.Create(test, r, piv);
 }
When I run it, the Image goes from being white to being transparent. I also get a weird error: !hasError UnityEngine.Sprite.Create(Texture2D,Rect,Vector2)
Can anyone see why the sprite is not appearing?
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                