Amato Armand Ezra studies as an apprentice to his silat master, Tok Sah Fazreen Mohd. He leaves to work on a school project with his friend Pian Ielham Iskandar, an automated drink maker known as the Cocoway-3000. In a prison spaceship, a group of alien robots are forced to fight in an arena, with a Power Sphere housing MechaBot Adzlan Nazir at its core. Grakakus Fadzli Mohd Rawi, a Power Sphere hunter, pursues the ship in order to capture MechaBot as part of his armor-making collection. Pian informs his father, Dr. Aman Feroz Faizal, founder of the tech giant DeStar in Kota Hilir, about the prison spaceship — a wreck Grakakus had crashed into Earth — which is nicknamed “Comet Aman.”
Passing by the wreckage on the way home, Amato meets MechaBot as Syabil Syamin Sah, in Maskmana, obtains a sample of the debris. Frightened, MechaBot provokes a fellow inmate, Troket Feroz Faizal as a warning. Troket then pursues Amato and MechaBot, during which MechaBot discards Amato’s Cocoway-3000. Grakakus unsuccessfully tries to find MechaBot in the wreckage.
Amato’s father Aba Anas Abdul Aziz discovers MechaBot, believing he is the project Amato worked on. MechaBot demonstrates his abilities to merge objects into his body and pairs with Amato, who is soon wearing a mechanized suit of armor built from MechaBot’s tech. The duo flee across a suspension bridge as Maskmana watches, and Amato saves Mara Marissa Balqis, a wheelchair-bound girl, from danger.
Grakakus interrogates Troket and learns that MechaBot is with Amato, and could be used to kill Amato the way he did to MechaBot’s previous master. Amato heads to school and tells Pian about the loss of Cocoway-3000. The class is introduced to Mara, and Amato and MechaBot fail to impress with a last-minute improvisation. Amato introduces MechaBot to his classmates and narrowly escapes an ambush by Grakakus’ robots. Pian tells Mara that his father is behind Maskmana, noticing a magazine cover featuring them. MechaBot confides to Amato that Grakakus planned to capture him, forcing him to stow away in the prison spaceship. Sah, in Maskmana, sacrifices his right arm to save Amato from Grakakus and Troket.
Aman fixes Mara’s wheelchair damaged in Amato’s clash with Troket, while Pian and Mara inform him about the ambush. At DeStar, Amato realizes that Aman, Sah and Mayor Andy Hazzley Abu Bakar are behind Project Maskmana, taking turns to fight crime under a secret identity. Sah reveals that the Maskmana suit was created from the same material as the prison ship’s hull, empowering its self-learning technology. Grakakus upgrades his armor with one of his Power Spheres, growing more dangerous.
MechaBot unpairs with Amato to avoid becoming a threat, while Aman plans to use MechaBot’s powers to defeat Grakakus before the hunter can capture him. Amato and his friends are pursued by Grakakus’ robots who capture Pian and Mara. As Grakakus wages havoc on Kota Hilir, Aman distracts him, and Grakakus breaks his spinal cord, allowing Amato to reach MechaBot. Grakakus demands Amato hand over MechaBot in exchange for Pian and Mara.
Amato tries persuading Sah to confront Grakakus with MechaBot to prove his worth, but Sah refuses due to declining health. He tells Amato about MechaBot’s past and how he regards him as a friend, convincing Sah to cancel the separation and allowing Amato to fully mechanize and face Grakakus. Aman and Amato save Pian and Mara as Grakakus jettisons them from his ship. Grakakus fails to merge with MechaBot, who subdues him and re-mechanizes with Amato. The two heroes defeat Grakakus and destroy his spaceship, leaving him crushed beneath the wreckage.
The group visit Aman in the hospital, where Andy informs them of another robot attack, so Amato and MechaBot set off for another mission. During several post-credits scenes, a grown-up Amato recounts the events of the film to his son, BoBoiBoy, and orders him a yellow Power Sphere, only to have a green, box-headed alien intercept the delivery. Aba, Andy, Sah and Aman discover an alien operating a shop in Grakakus’ spaceship ruins.