Can't make standalone build with multiple grids in one scene [Unity 2017.2]

  • November 14, 2017 at 18:04 #22399

    Hi.

    We’re using Apex Path in our project and everything was going good until I tried to make a new build this morning. We are using multiple grids and on build I have this error:

    Destroy may not be called from edit mode! Use DestroyImmediate instead.
    Also think twice if you really want to destroy something in edit mode. Since this will destroy objects permanently.
    UnityEngine.Object:Destroy(Object)
    Apex.SingleInstanceComponent`
    1:Awake() (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexShared/SingleInstanceComponent.cs:19)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    Which is only happening when we have multiple grids (on grid and the Unity build finishes without any problems)

    I can’t just change the line of code because it’s referring to a dll. (And / or I can’t find SingleInstanceComponent.cs)

    November 14, 2017 at 18:26 #22404
    Geminior
    Keymaster

    It would appear that you have multiple instances of either GameServicesInitializerComponent, PathServiceComponent or LayerMappingComponent.

    Did you perhaps clone the game world?

    The quick starts add a grid to the game world by default, but if you need multiple grids you should simply add additional grid components, not clone the entire game world game object.

    November 14, 2017 at 18:44 #22406

    Yes I found this out after posting the question. Should it be breaking the build though?

    Thanks a lot anyway!

    November 14, 2017 at 18:53 #22408
    Geminior
    Keymaster

    No it shouldn’t, but then Unity shouldn’t try to run code not meant for the editor in the editor and vice versa, so not really much we can do about it.

You must be logged in to reply to this topic.