Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Help Wanted Problem with UI and Sprite

Discussion in 'Visual Scripting' started by loafy123, Aug 26, 2020.

  1. loafy123

    loafy123

    Joined:
    Feb 19, 2020
    Posts:
    8
    I am creating a picture quiz game the generate randomly with only true or false.
    So i create array with list of pictures as sprite.
    Since my question is generated randomly I need to create an Image to hold the sprites, and Image = CurrentQuestion.But then I encounter several problems.
    With error :
    -An object reference is required for the non-static field, method, or property 'Questions.questionImg' Assembly-CSharp
    -Cannot implicitly convert type 'UnityEngine.Sprite' to 'UnityEngine.UI.Image'
    upload_2020-8-26_20-45-27.png
     
  2. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    84

    in you code line no 37 you not define CurrentQuestion class image
     
  3. loafy123

    loafy123

    Joined:
    Feb 19, 2020
    Posts:
    8
    How do i define it?
     
  4. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    84
    in GameManager debug class details
     
unityunity