(UPDATE: Everything else, including __nodes, is returning nil)
I am working on a CameraAPI. I am stumped on one thing, though. This used to work before (with the same code), but now it doesn't
I have a CameraApi table. It uses a constructor:
The module itself calls this constructor on its last line of code
(NOTE: I use self since CameraApi:Instanstiate() is syntax suguar for CameraApi.Instanstiate(CameraApi); self is an implicit argument which is CameraApi) The constructor returns the following metatable:
return setmetatable(Info, self)
Here's where I go deeper into the problem.
In Info, there is a class called Cutscene with the constructor
:CreateCutscene with the argument CutsceneName (which is stored in its "Info" table)
Now, I need to explain the functions.
It has a
__nodestable. It's with two underscores because it is meant to be private.
I use getters(accessors) and setters(mutators) for my Cutscene class
function Info.Cutscene:GetNodes() return self.__nodes end
I have a handy function which changes where the Camera Node faces.
function Info.Cutscene:SetNodeDirection() -- ... end
Whenever I call
:GetCameraNodes or print it, it returns nil
(By the way, there is nothing that sets __nodes to nil or something like that)
(Reminder: __nodes is nil in
:SetNodeDirection, but not in
:GetNodes or outside the module)
(It worked before; is it a bug from roblox?)