Open jamsch0 opened 9 years ago
Hi! Whats your target platform (even if your in the editor)? If your game is multi-platform, remember that the preprocessor args listed in the readme need to go the settings for each platform.
I'll look into this!
(also, when your posting stack traces, consider uploading a gist and linking it here =D)
I'm targeting PC only, and I'll keep that in mind :)
Are you running the example scene? x64? The log indicates that the lua dll is loading, but then you crash for a reason that's not given. The search continues...
Okay, so I just tried changing the build settings on my project to x86_64, which still resulted in a crash upon running in the editor.
I then loaded up the example project and ran the scene. Fine. I then added the following to the lua script in ExampleBehaviour.cs:
function Start()
local t = {}
function t:DoSomething()
Debug.Log('DoSomething() is working')
end
luanet.make_object(t, 'System.Object')
Debug.Log(t)
t:DoSomething()
end
which also ran without an issue. Perhaps you can think of something else I can test which could point towards what is wrong with my own project?
Edit: After poking around and with a combination of commenting/uncommenting lines I've tracked the crash to the following line in a particular Lua script of mine:
import("System.IO")
import("UnityEngine")
import("SectorEcho.World")
import("System")
BlockTest = {}
function BlockTest:IsSolid(direction)
return self.base:IsSolid(direction)
end
luanet.make_object(BlockTest, "SectorEcho.World.Block")
Debug.Log(BlockTest:GetType()) <- This line causes the crash
If I'm performing an illegal operation (I don't think I am?) this shouldn't crash Unity, only throw an Exception, right? Still haven't been able to reproduce this in the example project however...
Edit 2: Also, I should add that subclassing System.Object instead of my own Block class still induces a crash.
I've just upgraded NLua to the version included at the top of your master branch and switched over to KeraLua. As mentioned in the title, use of
causes Unity 5 to crash. I've included the stacktrace below in the hope that it is helpful (sorry for the length of the post!).