kleepklep Posted October 14, 2015 Share Posted October 14, 2015 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 More sharing options...
kleepklep Posted October 14, 2015 Author Share Posted October 14, 2015 I realize as an alternative I could use 2 bodies, destroy one on click, then change the other one to dynamic and make it visible, but I'd still be interested in how to do this. Link to comment Share on other sites More sharing options...
kleepklep Posted October 22, 2015 Author Share Posted October 22, 2015 I fixed this by using body.removeFixture(levelScene.getFixture('square')) Link to comment Share on other sites More sharing options...
Recommended Posts