#2360·love

Rope joints report incorrect type in LÖVE 12

Author: tpimhCreated Sep 3, 2026Updated Sep 3, 2026

Here is the snippet that you can test with (uses deprecated functions, but works on both LÖVE 11 and 12):

lua
function love.load()
  local world = love.physics.newWorld(0, 0, true)

  local b1 = love.physics.newBody(world, 100, 100, "dynamic")
  local b2 = love.physics.newBody(world, 200, 100, "dynamic")

  love.physics.newFixture(b1, love.physics.newCircleShape(10))
  love.physics.newFixture(b2, love.physics.newCircleShape(10))

  local rope = love.physics.newRopeJoint(b1, b2, 100, 100, 200, 100, 100, false)

  print("Joint type: " .. rope:getType())
  love.event.quit()
end

LÖVE 11 uses Box2D 2.3.2. Correctly reports the type as "rope". LÖVE 12 updated to Box2D 2.4.1, which removed this type of joint, but there are still some leftovers in the code. Incorrectly reports the type as "distance". My proposal: update to 2.4.2 (final release of version 2, removed the leftovers) and override the getType() to return the correct type: #2217.