Look at the picture i attached to see what i mean…
Here’s your problem
local a = function() b() end local b = function() print("abc") end
You want to call b from a, but you haven’t defined b yet. The solution is putting a and b in a table, like this:
local tbl = {} function tbl:a() self:b() end function tbl:b() print("abc") end
Now you can safely call tbl:a()
hey well this is my two functions… so i cant get your method to work,
local onCollision = function(self, event) if event.phase == "began" then local hit = self.value local other = event.other.value if other == 1 then --wallBottom Runtime:addEventListener( "collision", removeScene ) end return true end end local function removeScene() print("test") end
Here’s your problem
local a = function() b() end local b = function() print("abc") end
You want to call b from a, but you haven’t defined b yet. The solution is putting a and b in a table, like this:
local tbl = {} function tbl:a() self:b() end function tbl:b() print("abc") end
Now you can safely call tbl:a()
hey well this is my two functions… so i cant get your method to work,
local onCollision = function(self, event) if event.phase == "began" then local hit = self.value local other = event.other.value if other == 1 then --wallBottom Runtime:addEventListener( "collision", removeScene ) end return true end end local function removeScene() print("test") end