FeSe is one of the most enigmatic superconductors. Among the family of iron-based compounds, it has the simplest chemical makeup and structure, and yet it displays superconducting transition temperature ($T_{\text{c}}$
T
c
) spanning 0 to 15 K for thin films, while it is typically 8 K for single crystals. This large variation of $T_{\text{c}}$
T
c
within one family underscores a key challenge associated with understanding superconductivity in iron chalcogenides. Here, using a dual-beam pulsed laser deposition (PLD) approach, we have fabricated a unique lattice-constant gradient thin film of FeSe which has revealed a clear relationship between the atomic structure and the superconducting transition temperature for the first time. The dual-beam PLD that generates laser fluence gradient inside the plasma plume has resulted in a continuous variation in distribution of edge dislocations within a single film, and a precise correlation between the lattice constant and $T_{\text{c}}$
T
c
has been observed here, namely, $T_{\text{c}} \propto \sqrt{c- c_{0}}$
T
c
∝
c
−
c
0
, where c is the c-axis lattice constant (and $c_{0}$
c
0
is a constant). This explicit relation in conjunction with a theoretical investigation indicates that it is the shifting of the $d_{\text{xy}}$
d
xy
orbital of Fe which plays a governing role in the interplay between nematicity and superconductivity in FeSe.