Rex Dangervest

Rex Dangervest is galaxy-defending archaeologist, cowboy and raptor trainer and the main antagonist of the The LEGO Movie 2: The Second Part.

While at first appearing as an ally of Emmet Brickowski to be an embittered future Emmet who, after crashing and being thought dead by his friends, became resentful upon seeing them move on without him and built a time machine so he could travel back in time and cause the "our-mom-ageddon" as revenge.

History
While he was still Emmet Brickowski, Rex crashed his spaceship into an asteroid field and wound up behind a clothes dryer in the real world. After seeing all his friends continue to go on after his supposed death, Rex became resentful towards them and built a time machine so he could travel back in time and ensure the "our-mom-ageddon" occurred.

Rex saved Emmett as he was about to crash into an asteroid field and teamed up with his past self to venture to the Systar System and save his friends from the DUPLO Aliens. The two later arrive in the Systar System and Emmett destroys the reception cake at the wedding between Batman and the Queen of the DUPLO Aliens, Watevra Wa'Nabi. Emmett soon realizes after learning that the DUPLO Aliens only wanted peace between themselves and Bricksburg and seeing a hole in the universe appear in wake of the cake's destruction. The cake being destroyed is mirrored in the real world by Finn angrily destroying Bianca's Lego creations, causing their mother to scold them and tell them to put their toys away. Emmet tries to stop them but is prevented by Rex, who reveals himself as Emmett's future self and that he traveled back in time to ensure the "our-mom-ageddon" would happen. When The two fight and Rex knocks Emmett under the dryer so that he will continue to exist. However, determined to not become like Rex, Emmet return into the Lego world by sheer willpower and saves his friends. Emmet and his friends then team up with Wa'Nabi's forces to stop Rex.

Together, their combined forces manage to destroy Rex's time machine, causing to begin to disappear. As he fades away, Rex realizes that Emmet being saved by Lucy means he didn't ended up becoming him and tells Emmet to always be upbeat before fading completely from existence.