Refering to another actor through variables
Alright. Sorry for the second topic in less than a week.
In the script for an actor:
Code:
self.Number = 5;
local That = CreateAEmitter ("Thingamabob", "Faction.rte");
That.ParentVariable = self;
MovableMan:AddParticle(That);
In the script for "Thingamabob" :
Code:
self.ParentVariable.Number = self.ParentVariable.Number + 8;
However, this this causes a console error which reads something like
Error: (filepath to Thingamabob) Attempt to index field 'ParentVariable' (a nil value)
Thingamabob is only ever created through the actor's lua script.
How might I go about changing one object's variable from another using lua?