Hi, I’m not terribly familiar with Lua but I’m fairly experienced with OpenGL, Javascript and C++.
I’ve read the rendering and camera documentation articles. I followed given instructions very closely and I have difficult time understanding why I get the following error message:
ERROR:SCRIPT: main/camera/camera.script:4: attempt to index global 'self' (a nil value) stack traceback: main/camera/camera.script:4: in function <main/camera/camera.script:1>
camera.script is part of game object that consist of camera object and the script.
I’ve changed the bootstrap renderer to my renderer and followed instructions given here: http://www.defold.com/doc/rendering
I still don’t see the added 3D Model while running the game but I do see it in main.collection.
camera.script
function init() msg.post("#camera", "acquire_camera_focus") print(go.get_world_position("camera")) self.pos = go.get_world_position() self.look_at = self.pos end function update(self, dt) end function on_message(self, message_id, message, sender) if message_id == hash("look_at") then self.look_at = message.position end end
Thanks!