Instant Teleportation in 2D

Hey guys :slight_smile: I am trying to make a character teleport from one map/area to an adjacent map/area of the same dimensions, with a press of a designated key. The character would be teleportated in the exact same location in the second map/area as the location they pressed the key in the first map/area. Does anyone have any idea on how i can go about/tackle this?

Thank you (:

@sanketm182

Care to share any details?

How have you setup your “map/area”? Do you have single scene? One do you have a scene for each “map/area”?

Have you already tried something?

Do you have some code to show, or are you just asking how to create it?

Hey!
To answer all of your questions:

I am trying to create a 2d game with 3 maps in a single scene.
The player would be able to teleport to the same location on the adjecent map.

I have not tried something yet. I am asking how to create it and asking for some help/guideline on how I can go about doing this.

Thank you!

@sanketm182

Well then, those locations are not the “same”, just some arbitrary locations that you define.

You could create empty transforms, like spawnPosLevel1, spawnPosLevel2… and so on.

Then in your manager script you would have there available, and when you teleport to some level you just use that transform as location where you move your character and camera.