- Home /
Can not implicitly convert a unityEngine.GameObject from unityEngine.Coremodule.dll to unityEngine.GameObject from Unityengine.dll
hi, i am trying to make a .dll library in visual studio which i will later use in unity, i am making the library project as i will need to upload it as AssetBundle, Now: currentWorkingBlock = currentWorkingTexDraw.gameObject; this line workes perfectly in unity project but when i am making the visual studio dll file this line gives the error : Can not implicitly convert a UnityEngine.GameObject from UnityEngine.CoreModule.dll to UnityEngine.GameObject from UnityEngine.dll
can anybody tell me how unity is converting it internally, or any other way through which i can download assets and scripts from the server into the apk at runtime and build the scene? and, currentWorkingTexDraw is a texDraw object, texDraw is an asset that we bought for representing mathematical values.
I notice that the capital letter usage is quite inconsistent. Are you sure all the names are written correctly ?
Thankyou @metalted i have updated it please check and let me know if you can guide me with this issue.
Answer by Bunny83 · Mar 24, 2020 at 06:12 AM
You referenced the wrong assemblie(s) in your VS project. I haven't build my own assembly for Unity manually in the last years. Unity has not split it's core into several modules. So I'm not sure which one you should reference. For example for Unity version "2019.3.0f6" there is a combined UnityEngine.dll file at
"C:\Program Files\Unity\Hub\Editor\2019.3.0f6\Editor\Data\Managed"
But there's also the subfolder UnityEngine inside that folder which contains all the seperate modules:
"C:\Program Files\Unity\Hub\Editor\2019.3.0f6\Editor\Data\Managed\UnityEngine\"
As you can read in the documentation the GameObject class is now defined inside the module "UnityEngine.CoreModule.dll". Keep in mind that the namespace in which a class is defined has nothing to do with where the class is physically located (i.e. in which assembly / DLL file it is defined). You seem to reference two seperate assemblies which both implement the UnityEngine.GameObject class. since they reside in different assemblies they are not compatible with each other.
@Bunny83 thank you for the explanation, but is there any inbuilt module, or anyway i can make them compatible.