You can also create a bounding box using the Spine editor and create a physics polygon using that data. You can access it like this.
Enemy is an extension of the displayGroup returned by Spine with skeleton, bounds, and state rolled into it as well as methods for seeking targets, etc. You could use this same process to add physics to each of a models body parts, but that was unnecessary for our project.
When assembling the model:
local bounds = spine.SkeletonBounds.new() bounds:update(skeleton, false) --after assembly local bodyBounds = enemy.bounds:getPolygon(enemy.skeleton:getAttachment("bounds","bounds")) unpack(bodyBounds) for k = 1, #bodyBounds do if k % 2 ~= 0 or k ~= 0 then bodyBounds[k] = -bodyBounds[k] end end physics.addBody(enemy, "dynamic" ,{density = 0.01, shape= bodyBounds, bounce=0.0})
You invert points that are at indexes that are not divisible by zero, because Spine’s y-coordinate system is opposite of Corona’s. I hope this helps.