Jump to content

Table is empty at runtime, but not at start ? (or not accessible)


Slastraf
 Share

Recommended Posts

When I fill a table with grid prefabs, I have two for loops in each other and this:

 

table.insert(grid,gridPfb)

System:Print(#grid)

 

(#grid is the length of the table)

It prints 100 times, each time its bigger,, because its being filled.

But when I want to acces it from an other script , yes its a global table,

like this:

 

System:Print("STARTGRID : "..tostring(grid[1]))

 

I get this in Output:

 

STARTGRID : nil

 

What could it be and how to fix it ?

The length in runtime is also zero.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...