Could you send me the graph on that stage when the error is about to appear on loading it? So I could load it and get this error too to debug it. Ruonan, iddqd, probably I will need graphs from both of you just to make sure this issue has the same reason.
EnsureRunningOnMainThread can only be called from the main thread
Wait, what?!
Why should one check the main thread if it could be checked from the main thread only? Guess EnsureRunningOnMainThread has âreturn trueâ inside
BTW itâs Unity 2018.3.6 issue, in Unity 2018.3.3 everything works as expected.
I will make a project to reproduce this issue and send it to Unity since Iâm pretty sure it shouldnât work this way. For now here is a hack fix. Will submit it in a new version if Unity wonât fix this before.
Hey,
We are using Map Magic and we are really happy with it.
The thing is we want use a second Map Magic Terrain to have some kind of LOD setup with lower map resolution and no grass and trees/objects for a wide distance view.
Question 1:
Is there some settings for this in the Map magic Inspector?
Question 2:
If not how could we create a second map magic object and generate the low resolution terrain like we want via script?
We just have to get the coordinates of the Main Map and generate around this coordinates the Low resolution terrain, the transition does not need to be good because the player will never reach this low resolution terrain when the main map keep generating.
I already try it out but map magic does not allow to use multiple map magic objects in one scene also the question is how we stop the low resolution map generating automatically at the main camera so that itâs only visible in the background.
Itâs not built-in, but you can do it. MapMagic uses threading via a singleton so you CANNOT use two at the same time. You can swap between two in runtime though just fine, thatâs how I do it. Just make sure all the threads are finished in one before you turn it off, then turn the other one on. You can also specify chunks for it to draw instead of using the main camera, though it can be useful to leave the camera reference with a super high on/off distance so it doesnât automatically disable the terrains. Or you can have it generate around specific objects and place the objects yourself to represent which terrains you want it to draw.
If you are using a limited terrain then itâs probably better generate the low-resolution chunks beforehand, and then use only one MapMagic fore details in runtime. Using low-res terrains will not take much space, and you will not have to switch between two MM objects.
I have to admit that using singleton isnât a good practice in this case. MM2 avoids this disadvantage, though I had to redesign it greatly.
The most recent MM available at the Asset Store (v.1.9.7) was tested in Unity 2018.3.3.
If you are using a later version and have an EnsureRunningOnMainThread can only be called from the main thread issue take a look at [this fix]( https://discussions.unity.com/t/619852 page-77#post-4296724).
Feel free to email me any problems you encounter using MM.
Thank you for the response i will try to create my system probably in way 1 because we are working with a infinite terrain.
I updated Map magic to 1.9.7 and found out that something strange happens with my grass textures.
Im currently at Unity Version 2019.1.b6, and i canât downgrade because unity uses some other logic in itâs packages, how ever i get this bug:
Itâs only happens when you explore the world and walk to a chunk terrain which was not pinned and generated in the editor before so only at runtime generation, the default pinned terrain works without problems, also it only happens in a Build version not in the editor.
Is there something i have to take care from the textures settings?
I create new scene and new Map Magic object.
And I want to create it to prefab, so drag Map Magic object to Project view.
But terrain is disappered.
Maybe warning âTerrain Asset Missingâ in âTerrain 0,0â object under the Map Magic object is causing,
Is there any solution?
Map Magic Version is 1.9.7
Unity Version is 2018.3.0f2
Thanks!
I tried your fix but it didnât work - I got an error about object not being a texture 2d. I also now installed 2018.3.8f1, but the error is still there.
It would help a lot if you could run the same scene in a stable Unity version. Iâm not talking about the whole project, but you can export the graph and create MM object with the same settings in 2018.3, so no of the game logic will be used.
BTW was it working fine with the older MM version?
Itâs the standard behavior when you try to create a prefab of a terrain - any terrain, not only MM one. Youâve got to use TerrainData asset in case of a standard terrain, and MapMagic Data (graph) in case of MM.
Could you please email me the graph that causes the error?
Itâs planned for v1.10, but I can look into it tomorrow. Hope itâs the matter of days, but Iâm NOT promising that, itâs just a plan.
Will look into MicroSplat integration too.
I tested different Unity versions, 2018.3 works, 2019.1.0b5 works, 2019.1.0b6 donât works.
Probably they forget something or changed something in this version, itâs only effecting the Build Version and not the Editor.
In the demo scene build the bug behaves a little different, the grass texture is just not existing anymore in the new runtime generated chunk.
I donât know i just made a general function test and then i notice it.