You need to specify the full path from the root of the project and use ‘.’ as a path separator. So, if you have data.lua in my/path you would require it like this:
I am having this same problem. I am trying to call a module called camera.lua in a separate camera.script. I am getting the “This module cannot be found” error message. I tried your suggestion in completely writing out the full path using this
local camera = require (“lets go.content.main.modules.camera”)
my project is called "lets go"
the module is in a folder called “modules” within the “main” folder. Do you have any suggestions on where I should go from here? Thank you.
You should specify the path from the root of the project, ie from where your game.project file is. Judging from what you’ve written it seems like you shouldn’t include “lets go” (btw, I don’t believe a require directive can contain any white space).
Given the following folder structure:
project_root/
+---main/
| +---modules/
| +---camera.lua
+---game.project
local camera = require ("main.modules.camera")