It is really not that strange. I will try to explain.
What you need to know is that “complex” physics shapes are created by putting together multiple “simple” physics shapes.
When Physics editor creates a nested table like the one in your attached example:
["stoneGround6"] = { { pe\_fixture\_id = "", density = 2, friction = 0.30000000000000004, bounce = 0.20000000000000001, filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 }, shape = { -96.5, -6 , -184.5, 44 , -180.5, -22 , -139.5, -44 } }, { pe\_fixture\_id = "", density = 2, friction = 0.30000000000000004, bounce = 0.20000000000000001, filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 }, shape = { 174.5, -26 , 178.5, 45 , 80.5, -6 , 139.5, -44 } }, { pe\_fixture\_id = "", density = 2, friction = 0.30000000000000004, bounce = 0.20000000000000001, filter = { categoryBits = 1, maskBits = 65535, groupIndex = 0 }, shape = { -184.5, 44 , -96.5, -6 , 80.5, -6 , 178.5, 45 } } }
Each nested table describes a simple physics shape.
The reason your code didn’t work is that the physicsData:get(“stoneGround6”) call does not return a table - it returns an arbitrary number of tables, describing your “complex” shape from definitions of “simple” shapes.
And if you look in the docs for physics.addBody you will see it expects the multi-element bodies to be defined like this.
Not as one table but as an arbitrary number of tables:
physics.addBody( nebula, "dynamic", { friction=0.2, bounce=0.4, shape=podT }, { friction=0.8, bounce=0.0, shape=podR }, { friction=0.8, bounce=0.0, shape=podB }, { friction=0.2, bounce=0.4, shape=podL } )
This is the reason Physics Editor returns the data this way.
In other words in your project this line of code was the problem:
local data = physicsData:get("stoneGround6")
because only the first shape definition is assigned to the data variable. This is the reason you are seeing a simple shape instead of a complex one.
My proposed solution simply wraps the returned data in a table and unwraps it again when needed.
local data = {physicsData:get("stoneGround6")} physics.addBody( shape, unpack(data) )
Hope it makes sense to you now.