Closed ShadyChibinko closed 3 years ago
This has been fixed very recently in #69. I'll merge that now. The changes in that PR solve an issue I found when deleting bodies and fixtures in contact. When you modify a fixture's shape, the b2Fixture is deleted and recreated as mandated by box2d, hence the crash.
Thank you for the bug report :)
Fixed in now-merged #69
'size' being ambiguous depending on the shape type (i.e. Box2DRectShape=width/height, Box2DCircleShape=radius, etc.)
Godot Version: v3.2.2.stable
Branch: 3.x
Issue Description: If a Box2DFixture is in contact with another and you try to change the 'size' of its Box2DShape, the run executable will crash. It happens regardless of whether you increase, decrease, or reset the 'size' value to what it already is. Also occurs with fixtures in 'sensor' mode. I've tested this out with RectShape, CircleShape, and CapsuleShape. I can only assume Polygon and Segment behave the same.
Backtrace looks like this:
Steps to reproduce: Open the minimal reproduction project. Turn on 'Visible Collision Shapes' and run 'SetSizeTest.tscn'. Keys 1 & 2 shrink and expand the leftmost body, respectively. Keys 8 & 9 do the same for the rightmost body. Expand both bodies so they're colliding. Then try setting size again with any key.
Minimal reproduction project: Set.Size.In.Contact.Test.zip
Additional Information: Alternatively I've tried swapping out the shape resource entirely with a new one set to the desired size but it makes no difference.