@weilies: As with many other things, there are workarounds for features that are not built-in. In your case, what I’d recommend is create a method that handles changing the xScale and yScale of an object, and also removes the physics body and recreates it.
Using this method, you’d have to store a reference to your shape table to the object. The example below assumes you have a reference to the object’s shape table within a ‘bodyShape’ property (which you would have to set manually when you create the object).
Here’s an example:
-- method to change xScale and also modify bodylocal function changeScale( self, xScale, yScale ) -- modify object's xScale & yScale property (easy part) self.xScale = xScale self.yScale = yScale -- multiply the shape by the object's new scale local shape = self.bodyShape for i=1,#shape,2 do shape[i] = shape[i] * xScale shape[i+1] = shape[i+1] * yScale end -- remove and re-add physics body physics.removeBody( self ) physics.addBody( self, { shape=shape } )end-- now, be sure to add the method to your objects:obj1.changeScale = changeScaleobj2.changeScale = changeScale-- and when you need to scale an object:obj1:changeScale( 2.0, 2.5 )[/code]Some notes on the above:The changeScale() method as it is written above does not scale relative to object's current scale (as the scale() method does), it just changes the xScale and yScale to exactly what you set it to in the function arguments.Also, if you assign the method to objects as in the example above, when you call the method, don't forget to call it using a ':' instead of a '.'.Hope that helps!NOTE: I haven't tested the above code, so it's not guaranteed to be error-free, but the logic behind it should still apply just fine. [import]uid: 52430 topic_id: 19666 reply_id: 85673[/import]