It looks like you're new here. If you want to get involved, click one of these buttons!
local oncShotTweenChange = function(tween) local target = tween.target local body = target.xBody local x,y = target:getPosition() local scale = target:getScaleX() --print("scale:"..scale) --Set the position of the body body:setPosition(x,y) --Determine the shape of the body and set its radius. local shape = body.xShape shape:set(0,0,6*scale) end |
Comments
box2d manual says that:
"Box2D does not keep a reference to the shape. It clones the data into a new b2Shape object." Therefore, you cannot access and change the internal cloned shape data.
One possibility can be destroying and recreating the fixture with the new shape :-?