Make getNextWalkablePosition a generic function for any given node NOT just for frame node