So here's my problem. I've made a jbeam part that uses a custom controller with the path: \lua\vehicle\controller\. Inside the controller file there's a line of code: Code: M.update = nop When I try to substitute this function like this: Code: local function updateModified(dt) print("hi") end M.update = updateModified or like this: Code: controller.getControllerSafe("controllerName").update = function(dt) print("hi") end , nothing happens. The first way works for other lua modules though. Am I missing something? Any help appreciated!
Quick update. Probably I'll just use boolean flags and if-statements. By the way, I've also found another workaround to the problem: Code: local function testFunction(dt) print("hi") end local function update(dt) M.intermediateFunction(dt) end M.update = update M.intermediateFunction = nop After running Code: M.intermediateFunction = testFunction the module starts printing the word.