The path-name is correct.
public var pic : Sprite;
function Start(){
pic = Resources.Load("Targets/1") as Sprite; //pic becomes null
}
The path-name is correct.
public var pic : Sprite;
function Start(){
pic = Resources.Load("Targets/1") as Sprite; //pic becomes null
}
“1” is not a very descriptive filename; If I had to take a shot in the dark, do you happen to have two resources with the same name but different extensions? (a “1.png” and a “1.prefab”, for example?) - Resources.Load won’t know which to pick and so will return null in that case.
I’d recommend you give your resources more descriptive names.
Try using the generic overload: Resources.Load<Sprite>("name")