Jump to content

Box2D Plugin how to use removeFixture?


kleepklep
 Share

Recommended Posts

I have a R.U.B.E. loaded body containing two fixtures. One is named square, the other is named circle. How can I remove the square fixture with code? I'm trying to create a block that turns into a wheel when clicked on and starts rolling.
 
I am getting the body using game.physics.box2d.getBodiesAtPoint(x, y), but can't figure out how to target the fixture and remove it. bodiesUnderMouse.removeFixture('square') or bodiesUnderMouse.removeFixture(0) results in TypeError: a.GetBody is not a function.

Changing it to dynamic using bodiesUnderMouse.static = false works fine, so the body is found.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...