linepick help

Blitz3D Forums/Blitz3D Programming/linepick help

im trying to parent the player to the entity beneath the player using

groundpick$ = LinePick(player1\x,player1\y,player1\z,0,-12,0)

;If groundpick = player1\PlayerPivot Or groundpick=0
;EntityParent player1\PlayerPivot,0

;Else

;EntityParent player1\PlayerPivot,groundpick

;EndIf

however when the player falls from a height with nothing below, blitz just exits, when i run it in debug, it get the message "entity cannot be parented to itself!"