ABSTRACTGiant molecular clouds (GMCs) are believed to affect the biospheres of planets as their host star passes through them. We simulate the trajectories of stars and GMCs in the Galaxy and determine how often stars pass through GMCs. We find a strong decreasing dependence with Galactocentric radius, and with the velocity perpendicular to the Galactic plane, V$\mathrm{ z}$. The XY-component of the kinematic heating of stars was shown to not affect the GMC hit rate, unlike the Z-dependence (V$\mathrm{ z}$) implies that stars hit fewer GMCs as they age. GMCs are locations of star formation, therefore we also determine how often stars pass near supernovae. For the supernovae the decrease with V$\mathrm{ z}$ is steeper as how fast the star passes through the GMC determines the probability of a supernova encounter. We then integrate a set of Sun-like trajectories to see the implications for the Sun. We find that the Sun hits 1.6 ± 1.3 GMCs per Gyr which results in 1.5 ± 1.1 or (with correction for clustering) 0.8 ± 0.6 supernova closer than 10 pc per Gyr. The different the supernova frequencies are from whether one considers multiple supernovae per GMC crossing (few Myr) as separate events. We then discuss the effect of the GMC hits on the Oort cloud, and the Earth’s climate due to accretion, we also discuss the records of distant supernova. Finally, we determine Galactic Habitable Zone using our model. For the thin disc, we find it to lie between 5.8 and 8.7 kpc and for the thick disc to lie between 4.5 and 7.7 kpc.