Collision Segment not updating Z, what's really happening?

Hello.
I have a collision segment.

        self.manGroundRay = CollisionSegment(0,0,100,0,0,-1) 
        self.manGroundCol = CollisionNode('manRay') 
        self.manGroundCol.addSolid(self.manGroundRay) 
        self.manGroundCol.setFromCollideMask(BitMask32.bit(0)) 
        self.manGroundCol.setIntoCollideMask(BitMask32.allOff()) 
        self.manGroundColNp = self.man.attachNewNode(self.manGroundCol)

It is assigned to a collision handler queue.
Code:
        base.cTrav.addCollider(self.manGroundColNp, self.manGroundHandler) 
        base.cTrav.showCollisions(render)

this segment makes my avatar be able to move around on uneven terrain by using this line

        if (len(entries)>0) and (entries[0].getIntoNode().getName() == "terrain"): 
            self.man.setZ(entries[0].getSurfacePoint(render).getZ())

When I made the Collision Segment visible it appeared to originate from the centre of man and follow him around when his co-ordinates changed.

But that seemed to only happen with the X and Y because when the terrain my avatar’s walking over gets higher than the height of the collision Segment the Collision Segment stops being able to detect the terrain so man doesn’t get any higher.

so that prompted me to do this

print self.manGroundColNp.getPos()

and when I did this it showed that the coo-ordinates are always 0,0,0 but the Collision Segment will detect collisions no matter the X and Y but only the to what the height of the Collision Segment is in the Z.

so what I want to know is how to make it so that my Collision Segment follows my avatar up as it changes it’s Z co-ordinate changes instead of staying at 0.

and just a side note is there a way to ask if the Collision Segment is colliding with nothing?

thanks.

If I’m not much mistaken, your ray should have the coordinates (0, 0, 0) - those, I believe, should be in its local coordinate system, which should be relative to its parent: here being your “man”. Since you want it to stay with the “man”, it should have the coordinates (0, 0, 0), I believe.

As to the ray missing, you say that when you visualised the ray you saw it following the “man” - did it (visually) follow him up and down, or just in the x- and y- axes?

Otherwise I’m afraid that I’m not sure; if someone else doesn’t find a solution, perhaps post a screenshot (with the ray visualised), please - it might make diagnosis easier.