Why was the sundial invented?
It’s likely that it was an accidental invention: some ancient man (or woman!) stuck a stick in the ground, noticed that the shadow the stick cast seemed to follow a set pattern every day, & began to use that pattern to schedule things (for example, maybe their food source came to the watering hole when the shadow was at a certain point, so they would know to go to the watering hole at that point). Eventually the stick fell over, or blew away, or some jerk took it out of the ground, and they realized they needed a more permanent fixture, so they put a triangular rock on a circular rock and voila, the sundial.