You aren't the only one to have noticed that. I always did wonder why the Star Wars pilots didn't just attack from the rear of those star destroyers and fire into the large, undefended, glowing engine exhausts. Or aim at the knee of those walking dog things. Or why the defenders on the ice planet put their base on a nice, flat arctic plain ideally suited to the Empire's attacking forces instead of, for example, literally any other type of terrain. The goodies monumental incompetence is matched only by that of the baddies.Sooooo, in 2 or 300 years time space ships will have warp drive and all sorts of fancy gizmos and the weaponry, computer power and the detectors and sensors that go with it will be so much further advanced than what we have now (unless you’re a conspiraloon who believes ‘they’ have an alien space ship hidden in a secret base) which is radar and missiles which allows stand off and shooting at the enemy many miles away.
And yet the protagonists Star Wars and Star Trek and similar films need to throw their fighter spacecraft around zapping each other in almost visual range as if they’re in a WW1 dogfight.
Unless of course the weapons and sensor race will have effectively cancelled each other out and they have to resort to Battle of Britain tactics.