@FreebordMAD Great, that fixed it! Thank you for your support.
Iām having a strange problem with some of the image textures in the level editor.
For some reason, some of the items in the object selection area are appearing like that when the game is built. It is not happening while playing the game in the editor, just in the build. Do you have any idea what could be causing this? The particular images that are affected like this have the correct image, not the jumbled mess you see here.
Hi, thanks for using the MRLE.
Try adding all these textures to the resource folder. Please keep me posted if it did the fix.
EDIT: cool skin by the way
They are in the resource folder.
I was not having a problem with this before. Is there some limit to the amount of objects that can be added to the level editor or could this be a problem with an object that has animations?
I would just like to add on that Iām in Unity 2019.10f2
I canāt seem to find any obvious differences between images that are working and those that are not. Moving the image out of the project and back into it without the previous .meta file does change the image, just to another garbled mess of colors. How can I regenerate the image and see if that fixes the problem?
Check step 3 in the documentation below.
http://www.freebord-game.com/index.php/multiplatform-runtime-level-editor/documentation/level-objects
If I understand you right, then it doesnāt happen in the editor, but it does happen in the build. I suggest that you check the Unity Editor log directly after building. Search for the texture name you need. See if it says included with XY kb size.
Also, please check if the texture path on the object is really correct. See what the object map checker says on the object map (guide above). To rerender the icon delete the icon path saved in the LE_Object script of the prefab.
One last item I can think of is that you check if the texture import setting are the same especially for the platform you built for.
Revert when you have checked all the above.
Hey @FreebordMAD
Iāll try your next set of suggestions. As for the log, I believe that it is completing correctly, Iām certainly not getting an obvious build failure. This is for one of the .png files that are having a problem :
Updating Assets/ā¦(correct path omitted)ā¦/Eq_2.png - GUID: ff6e3ecbf709e674ea5d9735ec39fe85ā¦
done. [Time: 66.330500 ms]
As for the texture import settings, I believe by default that images generated are set to Editor GUI and Legacy GUI. I tried changing it to Sprite but that did not seem to fix the issue. Iām going to go get the images regenerated completely through step 3 in the link you sent me and see if that fixes my issue. Do you think this could potentially be a library folder corruption issue?
I was trying your solution about regenerating the object icons and I am getting this error:
Failed to generate preview for object prefab āEq_4-1ā at index ā7ā!
UnityEngine.Debug:LogError(Object)
LE_LevelEditor.Core.LE_ObjectMapInspector:RenderPreviewIcons(LE_ObjectMap) (at Assets/LapinerTools/LevelEditor/Scripts/Core/Editor/LE_ObjectMapInspector.cs:221)
LE_LevelEditor.Core.LE_ObjectMapInspector:OnInspectorGUI() (at Assets/LapinerTools/LevelEditor/Scripts/Core/Editor/LE_ObjectMapInspector.cs:50)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
Yet a .png is getting generated and seems to be fine though it is still having the same error in the build.
A similiar error is occuring for the other pngs that are not displaying correctly
Sorry to hear it didnāt help.
Two more ideas from my side:
-
Copy your whole project and then remove most objects and leave only a few on the object map including those causing the problem. If it still doesnāt work, then try to use these objects in a stock MRLE project - this project you can sent to me and I should then be able to reproduce your issue (currently I donāt know what to fix)
-
Try to delete the whole Library folder - do a backup. Then build again
Iāll try those next suggestions and see if anything helps. Quick question though, where is the particular section of code that loads those thumbnails into the object menu? I was just wondering if there is some read error occurring when either the .png file is being read or the image componentās image is being set.
Here are the code details:
- the resource path of the icon texture asset is saved in LE_Object.IconPath
- the texture is loaded via Resources.Load in LE_ObjectPrefabNode.uMyGUI_TreeBrowser_InitNode method - the LE_ObjectPrefabNode script is attached to the uGUI prefab of each item in the list
- the image is generated by the LE_ObjectMapInspector.RenderPreviewIcons method via AssetPreview.GetAssetPreview
I have some more details that may help:
- This problem does not occur in another project with the same assets.
- This problem does not occur when the affected scene is the only one in the build of the game.
Is this a memory issue or an corruption from another scene?
Edit - So through a lot of trial and error it seems that having my gameās main menu scene in the build settings causes the issue to occur for some reason. Iām still checking if its the specific load sequence (main menu > level editor) or if its simply the presence of the scene in the build. Do you have any idea why a scene with no connection to the level editor scene (minus a Scenemanager.loadsceneasync) would be causing this sort of issue?
Sounds like a confused Unity resource loader, could be caused by duplicate GUIDs, which Unity should detect itself or simply too many texture assets being in memory of the graphic card.
To release the graphic cardās memory. Try to load an empty scene before loading the level editor scene. In the empty scene call Resources.UnloadUnusedAssets, then load the actual level editor scene.
Hello! Quick question today:
Iāve noticed that the MRLE seems to randomize the surfaces heights slightly when we use the tools. For example, when I use the Set Height tool, not all of the points are at the same height; There are tiny dips and bumps, which was probably done to add more realistic design to the terrain.
How do we turn this feature off if we want?
Thanks!
Iām not aware of any code making the terrain rough on purpose. Have you set amount to max value? Is your brush full white?
Thatās something Iāve certainly never heard of happening. Iāll try that next. Question though, would that happen even if the (main menu) scene in my case didnāt have many assets/textures to speak of? I only have about 20 models in that scene minus a bunch of fairly simple UI elements. In the event that this is not the solution, what else do you think could be happening? I can certainly say that there are many assets that have been added to the level editor in my project. Is there a way I can get around this problem?
Edit - Donāt know if this will help, but I tried putting the level editor scene higher up than the main menu (so it is still in the build) and everything seemed to work fine in that instance
@FreebordMAD That does not seem to work either. I was reading into Bug: 4GB limit to Textures in standalone build . Do you think this could be my issue?
If so, how could I convert your system that uses the resources folder to use asset bundles instead?
@FreebordMAD That was the exact problem I was experiencing. While I didnāt use the solutions on that linked forum post, I did figure out that just moving the āObjectsā folder (where all the prefabs for the object selection are stored) out of the Resources both fixes the problem and still works correctly in the built version of the game Iām working on.
This is probably a much rarer issue that some of the posts on here, but maybe if someone comes over this one they can at least save two weeks of time hunting around for a problem that makes no errors in both the build and the console.
Summation of issue -
All āResourcesā folders within a particular Unity project cannot exceed 4GB due to a limitation on Unityās side of code at this particular time. Solution involves removing assets from the Resources folder in one way or another. Potential solutions can be found in a link of one of my posts just above this one.
Thanks for sharing the solution. I learned something new!
Glad it works for you now
Do you have an email address we can discuss something over?