Stuck on the tutorial

I am still very new to this language as I only started yesterday. This is the first language I am trying to learn on my own without any schooling help.

 

I am doing the chapters on the website and have made sure that all my code looks exactly the same as the website.

 

I, however, am getting an error and I am not skilled enough to actually know what is wrong.

 

The error says :

main.lua:108:ERROR:table expected. If this is a function call, you might have used ‘.’ instead of ‘:’

stack traceback:

[C]: in function ‘addBody’

main.lua:108: in main chunk

 

So I realized the error is obviously at line 108 and my 108 looks like this:

 

physics.addBody( newAsteroid, “dynamic”, { radius=40, bounce=0.8 } )

 

I literally took that from the chapter 2 page.

 

 

Can you maybe help please?

 

Kind regards

Emmie 

The error says it’s looking for a table, most likely as the first parameter where you have newAsteroid. It’s possible that the error is actually earlier in your code where newAsteroid is actually created. There should be a console log window open behind the simulator that has all output from your program. Look there for additional warnings. You need to figure out why newAsteroid isn’t a table (likely it’s nil).

Rob

The error says it’s looking for a table, most likely as the first parameter where you have newAsteroid. It’s possible that the error is actually earlier in your code where newAsteroid is actually created. There should be a console log window open behind the simulator that has all output from your program. Look there for additional warnings. You need to figure out why newAsteroid isn’t a table (likely it’s nil).

Rob