In hindsight, it does serve as a solid segue into the events of Infinity War and Endgame but, in Ultron, the execution is uneven.
Admittedly, this is probably due to the studio interference Whedon experienced with certain plot points.
Despite this, the film tells a messy story that doesn’t always know how to effectively service its numerous characters.
This lack of a clear direction also leads to a few plot points that feel somewhat awkward, particularly the sequence with Thor and Erik Selvig in the cave.