Original Post
Hi, I have created an object in Lua, but when I get the pointer using lua_touserdata, I'm not getting the same pointer. There is no error though.. Thanks in advance!
static Test* GetObject(lua_State *L)
{
lua_getglobal(L, "test");
int index = lua_gettop(L);
Test *pTest = (Test*)lua_touserdata(L, index);
return pTest;
}
// lua
test = Test:new()
test:doSomething()