Alienhead Posted May 7 Share Posted May 7 This has been happening awhile but I haven't came back to it yet because i havent needed to do anything like this until now. Here is some the code: --- Start the clouds for t=1, self.layer1Amount do uagc_clouds[t].mesh = self.layer1Cache[math.random(1,self.layer1TypeCount)]:Instantiate(world) uagc_clouds[t].mesh = Model(uagc_clouds[t].mesh) uagc_clouds[t].mesh:SetHidden(false) uagc_clouds[t].mesh:SetPosition(player.entity:GetPosition()) uagc_clouds[t].mesh:SetPickMode(0) local anum = math.random(self.minScale, self.maxScale) uagc_clouds[t].mesh:SetScale(anum, anum, anum) uagc_clouds[t].mesh:Translate(math.random(-self.maxDist,self.maxDist), math.random(self.minHeight,self.maxHeight), math.random(-self.maxDist,self.maxDist)) uagc_clouds[t].mesh:SetLodDistance(self.lod1, self.lod2, self.lod3) uagc_clouds[t].speed = Random(self.maxSpeed/2, self.maxSpeed) end --->> Move the clous for t=1, 40 do uagc_clouds[t].mesh:Translate(0,0,1) --- THIS LINE ERRORS OUT !, says uagc_clouds[t].mesh is nil when clearly the code above sghows it isnt. end Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Josh Posted May 7 Share Posted May 7 How do you know that layer1Amount equals 40? That seems very odd to hard-code the array size. You can use #uagc_clouds to get the array size. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution Alienhead Posted May 7 Author Solution Share Posted May 7 Yah I saw that error as soon as I posted this message. Seems to be NO WAY to delete a topic anymore so I had to just leave it. Quote I'm only happy when I'm coding, I'm only coding when I'm happy. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.