I am using box2d, and in the function where I create a ball, I tried to add an event listener to ball.body. However, it gives me this error:
Scenes/game.lua:86: attempt to call method 'addEventListener' (a nil value)
stack traceback:
Scenes/game.lua:86: in function 'ball'
Scenes/game.lua:49: in function 'init'
[string "property.lua"]:52: in function '__new'
[string "property.lua"]:59: in function 'new'
Libraries/sceneManager.lua:279: in function 'changeScene'
Scenes/menu.lua:44: in function
Does anybody know why this is happening?
Comments