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: