Is your ladder actually upright? Superku's line should work independently whether the player is in the middle or at any end of the ladder, because of the zero at the z value of the vectors.

Just an idea, replace "0" in both vectors by "player.z".