Pivot Problem

Blitz3D Forums/Blitz3D Beginners Area/Pivot Problem

When the player (guy) is at certain distance from both pivots on the map, the camera is snapped into a particular place. I must be doing the first line of code wrong, because it's not working:

If EntityDistance(guy,pivot1) < 19 And EntityDistance(guy,pivot2) > 20 Then
PositionEntity cam,-5.349,6.429,50.7331
RotateEntity cam,0,-71.2019,0
TurnEntity cam,32.6007,0,0
EndIf