This is how at Danny Phantom's world and escaping the Ghost Prison goes in Crash's, Thomas' and Ryan's Adventures of Nicktoons: Unite!.
[The gang arrives in Danny's world in some kind of castle throne room]
Retlana: Retlana thinks it must be Danny's world. Megatron is not here.
Emmet: Ryan? Is that you?
Retlana: Retlana is one of Ryan's alternate personalities.
Ranyx: Be right back. [Hides behind a door] Ok, Rikki. I hope I can transform.
Ranyx: I remember Ryan's training. Rikki, spots on!
[Rikki enters the neck collar he's wearing and Ranyx transforms into Ranybug]
Matau T. Monkey: Ok, Jimmy. What is the plan?
Jimmy Neutron: Wait a minuet, Matau. Something's not right. I set the machine to take us to Danny's school, but I must have made a miscalculation.
Bertram T. Monkey: Yeah. We should be at Casper High right now.
Ryan-Ko: What's going on?
Vlad Plasmius: Oh, you've made no mistake. I've taken up residence at Casper High or at least where Casper High once stood. I'm glad you could finally make it. I've been waiting for you all to arrive.
[Retlana gasps and turns to Ryan]
Ryan F-Freeman: Vlad Plasmius?
Unknown voice: He's not alone, Prime.
[Master Xehanort comes out of the shadows]
Evil Ryan: Master...
Bertram T. Monkey: Xehanort?
Madam Magianort: What?
Ranybug: Why are you with Vlad?
Master Xehanort: Well, you see, Vlad and I have been gathering ghost energy from his Ghost Portal.
Vlad Plasmius: And who is that ladybug boy?
Ryan Crittenden: That's Ranybug.
Ryan F-Freeman: Yeah. He's a Miraculous superhero.
Master Xehanort: Miraculous? Sounds like something Hawk Moth wants.
Ranybug: I hope your plan fails, Xehanort.
Sci-Ryan: You think you are cool, Bugaboo?
Ladybug: Hey! Sorry I'm late.
Emmet: Ok, Xehanort. You stop what you and Vlad are doing or Ryan will whack you with his Keyblade into next week.
Master Xehanort: Ahahahaha. Oh, it's not that simple, Special. We have the upper hand. [shows them Jack and Maddie Fenton]
Matau T. Monkey: Oh my G-O-S-H!
Aryan: What the...?
Vlad Plasmius: [to Danny] All you need to do is join me and Xehanort and I will let them go.
Sci-Ryan: We would rather he die then join you.
Emmet: Actually I'd rather the ghost boy didn't die.
[Ryan gets a vision of Megatron]
Starscream: Praise the Allspark! Master! You're alive!
Starscream: Your new battle armor will take things to the next level, My liege. Together we will reunite all Decepticons and once again grind Cybertron under your mighty heel!
Starscream: What? Why?
Megatron: Because I know that Ryvine is my friend. So is Organization 13.
[Sunset starts to cry]
Ryvine Sparkle: Sorry, Sunset. Megatron is a bad guy. Your past... present and future are today!
[In reality, Ryan mumbles the words]
Evil Ryan: Ryan? Ryan! Hellooo? Galvatron?
Megatron: [groans in frustration] Snap out of it! [whacks Ryan on the head]
Ryan F-Freeman: Ow! Uhh... [mini versions of Crash run around his head] Did you lost your memories, Megatron? 
Crash Bandicoot: Looks like you needed that.
Master Xehanort: Time to join us, Lord Megatron! [uses his magic to Transport Ryan and the heroes to the Ghost prison leaving Megatron behind]
Megatron: [laughs evilly] I am not a hero anymore!