Hello. I’m trying to remove some balls from stage (These balls are thrown like the balls from the awayphysics examples; applyCentralImpulse, etc) but removechild doesn’t seem to work.
What am I doing wrong?
private function onMouseUp1(event : MouseEvent3D) : void {
sphere = new Mesh(new SphereGeometry(40),material);
var pos : Vector3D = new Vector3D(pPositionX, 2500, -2000);
var mpos : Vector3D = new Vector3D(event.scenePosition.x, event.scenePosition.y+1000, 3900);
body = new AWPRigidBody(sphereShape, sphere, 18);
body.addRay(new Vector3D(), new Vector3D(0,125,0));
var impulse : Vector3D = mpos.subtract(pos);
impulse.normalize();
impulse.scaleBy(8000);
body.position = pos;
escena.addChild(sphere);
physicsWorld.addRigidBody(body);
}
and then
escena.removeChild(sphere);
physicsWorld.removeRigidBody(body);
but the balls keep on the floor…