Skip to main content

Shapes

Each region of the softbody has one collision shape, on its rigidbody. To see them, turn on Shapes in Debug Draw, which works in the editor and in game:

shapes

The actual hierarchy inside the node is as follows:

  • RigidBody2D: contains
    • CollisionShape2D
    • RemoteTransform2D (moves the bone that deforms the texture)
    • Joint2D nodes, one per neighbour

Shape properties

The Shape parameters section contains:

  • Radius: the size of the shape. Circles get half of it as their radius, squares get it as their side. It defaults to a little under Vertex Interval, so neighbouring shapes nearly touch.
  • Shape Type: Circle (the default) or Rectangle.
  • Edge Clearance (in the Region section) keeps every shape just inside the texture, like this:

Center Image

Circles or squares?

Use circles on the hexagon pattern. A square the size of the spacing already overlaps its diagonal neighbours at rest, and once rotated its diagonal reaches its second neighbours, which do collide: 40 to 86 self contacts on a resting softbody against 2 with circles. Squares still suit the rectangle pattern. The editor warns about squares on hexagons.