- Home /
Resources.Load("sprite") returning nil
I'm trying to load a sprite named "weapon" using:
var sprite = Resources.Load<Sprite>("weapon");
but sprite is returning nil... What am I doing wrong? Do I need to specify the file's path?
Comment
Is the sprite located in the Assets->Resources Folder?
Try var sprite = Resources.Load("weapon",Sprite);
and yes make sure the sprite is in the Assets->Resources folder, and that is spelt case sensitive as "weapon".
Your answer
![](https://koobas.hobune.stream/wayback/20220613144811im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Accessing 4.6 GUI build-in sprites in C# 0 Answers
Loading a mesh? 1 Answer
Resource.load general question 0 Answers
How do you load a single sprite from a multiple sprite sheet with script? 1 Answer
Resources.Load wont read text file 6 Answers