How do I Remove a Constraint in the BGE I saw a game demo where a wooden crate broke into planks when it was hit by an object. I want to do something similar. I assume it's done with constraints, and I found a reference to a python function for removing constraints (called removeConstraint()) but I'm unfamiliar with python scripts so I don't know how to call it and I can't find any examples. The reference is this function is here:

http://www.tutorialsforblender3d.com/GameModule/ClassKX_PyConstraintBinding_4.html

Can anyone help me to understand how to use this function, or how else I might create breakable crates?
Most often, objects breaking up is done by, when hit by something, ending the original object and replacing it with one or more rigid bodies. (ie using add object/end object actuators or the python equivalent)

Now, on to constraints. I know no way to get the constraint if it was made in the user interface. There simply doesn't seem to be a method to get constraints. But if you create the constraint from python and store it's ID's, then you can manipulate it/destroy it.

To create a constraint (this is for a wheel, free to rotate in one axis):

def joinWheel(wheel, axle):
    obj1 = wheel
    obj2 = axle

    id1 = obj1.getPhysicsId()
    id2 = obj2.getPhysicsId()

    '''bge.constraints.createConstraint(physics_id_1, physics_id_2,
                             constraint_type,
                             edge_position_x, edge_position_y, edge_position_z,
                             edge_angle_x, edge_angle_y, edge_angle_z)'''

    obj1['joint'] = bge.constraints.createConstraint(id1, id2,
                             bge.constraints.GENERIC_6DOF_CONSTRAINT,
                             0,0,0,0,0,0)

    obj1['joint'].setParam(0, 0.0, 0.0) #No X translation
    obj1['joint'].setParam(1, 0.0, 0.0) #No Y translation
    obj1['joint'].setParam(2, 0.0, 0.0) #No Z translation                     
    obj1['joint'].setParam(3, 0, 0) #No X Rotation
    obj1['joint'].setParam(4, 0, 0) #No Y Rotation
    #obj1['joint'].setParam(5, 0, 0) #Commented out so there is z rotation


And now we have a reference to the constraint stored in objs['joint'] which can be removed with:

def removeWheel(wheel):
    bge.constraints.removeConstraint(wheel['joint'].getConstraintId())