Poly Proxy: collide

collide
  • Returns whether or not the polygon will detect collisions.

Return Type:

  • boolean
  • True = detects collisions
  • False = doesn't detect collisions
    Note:
    • Materials on the mesh have to be assigned to different faces on the mesh.
        
    • If a material is assigned to same faces as another material, only the first material name will be returned.
    Sample Code

    ############################# get polygon collision

    # import bge
    import bge

    # get the current controller
    cont = bge.logic.getCurrentController()

    # get object that owns this controller
    obj = cont.owner
     
    # Get a list of the mesh
    meshList = obj.meshes

    # Get the first mesh on the object
    mesh = meshList[0]
     
    # get the first polygon on the mesh
    poly = mesh.getPolygon(0)

    # collision turned on?
    collision_on = poly.collide