Writing one of my first programs in Lua with the Corona SDK, and I’m getting the following error:
main.lua:10: bad argument #-2 to ‘addBody’ (Proxy expected, got nil)
Here’s my code. It’s probably just a stupid syntax error.
physics.addbody
When you have an opportunity like this, look at some code that works or compare your code to the API reference. : vs. . is Lua. Play with : and . until you know you know it. [import]uid: 12635 topic_id: 5769 reply_id: 20201[/import]
I’d rather have a technical description, personally. I’m sure I can find that somewhere else, however. [import]uid: 30657 topic_id: 5769 reply_id: 20416[/import]
I now understand the difference between ‘:’ and’.’, but even when the code is written as
physics.addBody( object, { tableValues }
I did not add any table values other than the “collisionFilter” because I only wanted to use the physics to enable the collision filters. Could that be the the reason for my errors?
Here is my code:
One thing I love about Corona is how founders are willing to come and help developers with in the forums. Thanks for your help with this! [import]uid: 38000 topic_id: 5769 reply_id: 45295[/import]