After Michael Bay’s last atrocious “Transformers” movie “The Last Knight,” you really had to wonder whether another based on the Hasbro toy line was necessary. Perhaps not, but “Bumblebee” shows that the franchise about alien robots that turn into cars still has some gas left in the tank.

Directed by Travis Knight with a significantly lighter touch than Bay could ever manage, the movie is a prequel of sorts, being set in 1987 as the war between the Autobots and the Decepticons back on Cybertron has reached crisis point and Optimus Prime (voiced by Peter Cullen) must order retreat and retrenchment. He tasks B-127 (Dylan O’Brien), later to be called Bumblebee, to travel to earth to protect the planet as a future refuge for his reassembled force of warriors.

B-127 follows orders but crash lands in the middle of a Special Ops training exercise being led by a gruff military man named Jack Burns (John Cena); a firefight and chase ensue, ended only when Decepticon Blitzwing (David Sobolov) intervenes in pursuit of B-127. In their battle Blitzwing destroys B-127’s voicebox and damages his memory, but B-127 rallies, defeats Blitzwing and goes into hiding.

Thus far the picture has been standard-issue if smaller-scaled “Transformers” fare, and frankly none too interesting. Now, however, the focus turns to Charlie Watson (Hailee Steinfeld), a girl living in a nearby Northern California town who’s just turning eighteen. Still mourning the death of her beloved father (heart attack) and trying to get along with her mom Sally (Pamela Adlon), stepdad Ron (Stephen Schneider) and younger brother Otis (Jason Drucker), she’s bullied by the mean girls even as Memo (Jorge Lendeborg, Jr.), her neighbor and co-worker at the local boardwalk, is clearly infatuated with her. (We’ll also learn that she was once an avid high diver, but is terrified to jump since her dad, also her coach, died. Naturally that wrinkle will reappear in the climactic action scene.)

What Charlie wants more than anything is a car, and kindly junkyard owner Hank (Len Cariou) gives her one as a birthday gift—a broken-down yellow Volkswagen Beetle she’s found on his lot. It is, of course, B-127 in disguise. It’s not long before Charlie’s work on the car causes B-127 to emerge, and after coming to terms with the transformation she calls him Bumblebee (after a nest that had settled in the Volkswagen’s interior). They bond, of course, and Memo gets involved with them too, which takes the movie into “E.T.” territory, with slapstick sequences of the robot trashing the Watson home (and taking comic revenge on mean girl Tina, played by Grace Dzienny) while learning to converse, after a fashion, by using pop tunes of the period he accesses by moving through a radio dial.

Charlie’s efforts to repair the car have also released a hologram of Optimus that begins to trigger Bumblebee’s memory; unfortunately, it also serves as a beacon for two Decepticons, Shatter (Angela Bassett) and Dropkick (Justin Theroux), to follow B-127 to earth, where they persuade scientist Dr. Powell (John Ortiz), a throwback to the naïve researchers of old 1950s sci-fi movies, and in turn the U.S. military establishment, to help them track him down; they say he represents a common threat. That returns the movie to “Transformers” mode, though the “E.T.” thread never entirely disappears, as Charlie, Memo, and even Otis, Sally and Ron join the battle on Bumblebee’s side. (In the end, even Burns becomes convinced that they’re right.)

That seems an odd combination, and there are other movies one could point to that bear some similarity to “Bumblebee” as well—not least last year’s bomb “Monster Truck” (not to mention Disney’s “Love Bug”). But writer Christina Hodson brings a genial sense of humor to the proceedings, and Knight uses the nostalgic thirty-year old references to nifty effect, not only in the use of pop tunes, but innumerable cultural references that viewers of a certain age will savor. The cast throw themselves into the spirit of things, with Steinfeld creating an engaging young heroine and Lendeborg an equally agreeable sidekick; in his few scenes Drucker proves an asset, too—though we didn’t need his throwing-up scene. Then there’s Cena, who once again shows that he has considerable comic chops to go along with his he-man physique.

Of course, for all its pleasures this remains a “Transformers” movie, and the protracted battle sequences have a been-there, done-that quality that makes one’s heart sink whenever they pop up. (The CGI in these scenes, moreover, is visually a bit messy. Happily, it’s better in the scenes in which only Bumblebee is involved.) There are also too many resurrection moments—when Bumblebee has apparently been killed but suddenly reawakens (“E.T.,” of course, had only one). But Enrique Chediak’s cinematography is fine, and editor Paul Rubell has kept things to a trim running-time of under two hours, a nice change from most of today’s overlong superhero entries.

By itself “Bumblebee” doesn’t justify the continuation of “Transformers” franchise—nothing could completely make up for “The Last Knight”—but it’s better than anybody had a right to expect.