Lua module based movement

Hi all!

Im relatively new to Defold and im currently developing a platformer game. I have a LUA module called skeleton.lua ( attached below ) and a skeleton movement script ( also attached below ) , the skeleton.lua module contains functions that handles movement, tile map collision and updating animations. The skeleton movement script then uses these functions in order to move a GO on a tile map.

Lua module :
skeleton.lua (2.3 KB)

skeleton movement script :
skeletonMovements_module.script (1.2 KB)

My problem is when the game is built there are not any errors however the skeleton GO just falls to the tile map and doesn’t move left or right. I don’t believe the issue is related to collision shapes as I have tested, as a result I am drawn to it being an issue with my LUA module code or the use of the module code in the skeleton movements script but I cant figure out what the issue is.

I hope I have been able to express my issue in a way that is understandable. Please let me know if you need more information.

Thank You

Line 26 in skeleton.lua, self.gravity is used but not defined anywhere?

local acceleration = vmath.vector3(0,self.gravity,0)

3 Likes