Rigidity method for automorphic forms over function fields