Mae Hartley [Kelli Berglund] is a bright tenth grader who secretly pines for the popular jock Jaden Stark [Noah Centineo], whom she tutors and hopes will invite her to Homecoming. When the mean cheerleader Nevaeh Barnes [Ashley Argota] publicly humiliates her and makes a show of dating Jaden, Mae claims she already has a boyfriend. To cover the lie, Gabby Harrison [China Anne McClain] proposes to program a virtual boyfriend using a cutting-edge software called X-17, which they believe Mae's father, Dr. James Hartley [Roger Bart], uses to design high-definition video game characters for his company. Gabby creates a virtual boyfriend according to Mae's instructions, naming him Albert.
The software malfunctions and crashes James Hartley's computer. Mae's brother Bart Hartley [Matt Shively] agrees to fix the machine if Gabby will go to homecoming with him. The next morning, Albert arrives at school and quickly becomes popular; he reads at an incredible pace and can throw or kick with a power beyond ordinary humans. Bart and Gabby realize that Mae inadvertently created a robot soldier and even hacked into the Pentagon, since James Hartley works for the Pentagon. General McFee [Ron Lea] discovers that the X-17 prototype robot is missing.
Later that day, Albert asks Mae to Homecoming. Feeling overwhelmed, she explains that she does not feel worthy to be his girlfriend. Gabby worries that the situation is spiraling out of control, and Mae agrees to go with Albert.
At the Hartley house, Bart and Gabby witness Zephyr [Paulino Nunes], Weevil [Matthew G. Taylor], and Pox [Alex Karzis], members of the international arms dealer group Black Sigma, break in search of the prototype. During a school football game, Gabby tries to warn Mae about Albert being a robot, but their conversation escalates into a disagreement. Albert is chosen to play and helps the team stage a dramatic comeback. Soldiers led by General McFee arrive after an EMP-caused blackout caused by Black Sigma short-circuits Albert's wiring.
Black Sigma's intrusion is contained by the army, and Albert begins a global mission to fight danger. Mae and Gabby are told by General McFee to forget about Albert, but Mae remains hopeful that he will still attend the homecoming dance, and James is surprised when he does. McFee plans to retrieve Albert, but James convinces him to wait until Albert completes his mission, which is to kiss Mae at the dance. The army then works to make the night perfect for Albert and Mae, even going so far as to stuff the ballot box to crown them Homecoming King and Queen.
Nevaeh Barnes [Ashley Argota] tries to ruin Mae's night but is dumped by Jaden Stark, who admits he had intended to ask Mae to Homecoming but lacked the courage. Gabby and Mae reconcile. Then Mae and Albert share a dance; but when he leans in to kiss her, she pulls back and admits that, even though the moment is flawless, it doesn’t feel right. She wants a real relationship with a real boy who isn’t perfectly engineered. Albert is impressed by her honesty and explains that the army is there to retrieve him, so Mae asks him to self-destruct. He complies, lights pulsing, and destroys himself by bursting through the venue ceiling.
Bart covers and thanks Principal Fragner [Richard McMillan] for the “awesome special effects.” The party continues, and Jaden asks Mae out. She tells him she’ll think about it, but confirms that no boy will come between her friendship with Gabby. Yet Gabby reveals she’s changed her mind about boys and is now dating Bart.