Post this line of code in your project…my guess is that it says res too and in which case move everything to res/ or whatever directory this line says or add another path…
getSpriteFrameByName is only used if you’ve loaded a spritesheet that contains that specific frame in it, as @slackmoehrle shows in point 2 of the post above.
From your description and screenshot, it seems that you’re just trying to load an image from a file, so you need to use Sprite::create("filename.png"). For your specific case, it would be Sprite::create("character/idle/0001.png");.
If you want to add the character or character/idle to the search paths, then do this:
auto* fileUtils = FileUtils::getInstance();
fileUtils->addSearchPath("character"); // if you want to use Sprite::create("idle/0001.png"); etc.
fileUtils->addSearchPath("character/idle"); // only if you want to use Sprite::create("0001.png"); etc.
I don’t recommend you add those paths to the search list, because if you have multiple characters, and each has graphics that use the same file names, such as 0001.png, then it’ll always pick the first one it finds, which may not be the one you want.
Again, you cannot use getSpriteFrameByName, because the images in your resource path are not frames of a sprite sheet. That function only deals with frames that exist in a sprite sheet, and you’re not using sprite sheets. The name of that function is perhaps a little confusing, and it’s not doing what you think it is.
If you do want to use getSpriteFrameByName, then create a sprite sheet using TexturePacker app or similar (other free options out there).
I use to prefix names as well, but it became a maintenance issue, and realised it’s easier to use paths to distinguish between different resources, so regardless of how many images have the same name, the relative path to them is always unique.