I'm making a 2D game. In my StreamingAssets folder I have a JSON file with some info about inventory items (id, description, rarity, name, is stackable or not) and a png file which contains a pixel map (128x32) of the level I want to load after a first scene (this is from Quill18's tutorial: https://www.youtube.com/watch?v=5RzziXSwSsg , basically a specific color corresponds to a specific prefab. An object reads through all the pixels and then spawns the level). The fact is that I have issues with both these elements when the game is built (everything works perfectly in the game window in Unity): the inventory items don't collide with the player and the level is not loaded.

This is the code that gets the image name

public string levelFileName;
string filePath = Application.dataPath + "/StreamingAssets/" + levelFileName;
byte[] bytes = System.IO.File.ReadAllBytes (filePath);
Texture2D levelMap = new Texture2D (2, 2);
levelMap.LoadImage (bytes);

And the pickable objects basically have a collision detection script and have a specific ID, so that when they collide with the player, the inventory adds in a free slot an image with the specs correspondant to that ID (i.e. ID=1 then it's an health potion, is stackable, it's not rare and so on). Everything else works fine in the game. Do you think that the issue is linked to the StreamingAssets folder (first time using it) or is it just a coincidence? And also could you help me solve the problem? Thank you in advance for any kind of help.

Edit: my Player logs:

enter image description here


1 Answer 1


To me it looks like part of the code was simply not executed due to an error. You should get the logs for your build and check if you do not have any error.

You should not assume that because you do not have errors in the editor you will not have any in the build.

You can find the info here : unity logs


The streaming asset path might change depending on the platform you are building to or on the version of Unity you are Using you should use


instead. All info here : Streaming assets path

  • \$\begingroup\$ Hi, thank you for your answer. It looks like you put me on the right track. I updated the question adding the screenshot. I named the build UntitledDelete just to test things out. If I'm reading this right, it looks like it can't find the files I'm referencing. Can you help me further? \$\endgroup\$
    – Jules
    Commented Oct 30, 2016 at 7:42
  • \$\begingroup\$ What platform are building for? Linux? \$\endgroup\$ Commented Oct 30, 2016 at 8:15
  • \$\begingroup\$ In the build settings I selected "PC, Mac & Linux Standalone", but I'm playing and developing it on the Mac \$\endgroup\$
    – Jules
    Commented Oct 30, 2016 at 8:19
  • 1
    \$\begingroup\$ I edited my answer to include what i think is the actual solution. \$\endgroup\$ Commented Oct 30, 2016 at 8:43
  • \$\begingroup\$ Thank you so much for your help, you solved a problem I had been working on for a week now! \$\endgroup\$
    – Jules
    Commented Oct 30, 2016 at 10:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .