Portals

For my game, I want my player to be able to use portals. How this is going to work, I have no idea - though I theorise extractors has something to do with it. It is a side scroller platformer. I have not yet begun work on the portals. What U want is when you walk through one, lets say portal a, you come out of portal b, 2 seperate objects. Ia it possible to have more than one of each in a level? Or should there be portal C and D as well? I just want this all explained with a screnshot and a simple explanation of the code bellow. I will call out @“JR 01” and @Superstargames and @seamothmaster45 for being so helpful in all my other forums and hopefully being able to help in this one. The character is 2x2 and the portal should be the same size. Anyother questions to specify what I would like should be posted bellow. Here is the link to the game:
https://flowlab.io/game/view/1387014

How well you want the portals and where/how the portals are placed are important on the set up.

The basic idea for a portal is that you extract portal a and portal b,
that’ll be your 2 points the player can teleport to.

If you want the object to be sticking halfway out of the portal, then your wanting some more advance area using 2 objects as the illusion of 2, as well as each portal being made up of 2 objects for half the portal would be on a layer in front of the player.

So @“JR 01” for the basic way, you have the player extract the x and y of portal b when touching portal a? Sorry, I am a bit confused at this one, maybe give an exwmple plot screenshot of code? Or just re explain it. I’m dumb. Really. Sorry.

@Superstargames @seamothmaster45

Almost, extract them when they exist or use an Always. Use a trigger like collision to actually send the player.

Could you make a quick example (sorry to be a hastle) and post what to change @“JR 01” ? Yo have been SO helpful :slight_smile:

I am still a bit confused… Are you saying the player should always extract x or y or only on collision?

He might be saying extract on collision, so that the player doesn’t get stuck on one side of the portal.

Both… use the “set” on the number block to see the number and use “in” on collision.

2020.04.10-11.34

@“JR 01” there is my other problem about extractors. It always wantd the object and the type instead of just the object in general. Thank you for the code, is this for the player, portal, or portal b? @Superstargames

@“The Kodex”, that looks like it should be for the player, because the numbers are hooked up to a position block. And the player is the one that is teleporting through the portal.
Wait… a teleporter teleporting…? That’s confusing. Jokes aside, the screenshot shows your the behaviors for the player.

Superstargames is correct, that goes to the Player.
If its for general type a and b portals (like acorss levels), you can extract this X and Y in the portals and message the player.

Player:
2020.04.10-13.49

Portal:
2020.04.10-13.50

Is that last set of code @“JR 01” For Portal A or B? Or Both?

@“JR 01” i done the code for both and well… I’m a bit confused at what id does… Take a look and see for yourself:
https://flowlab.io/game/view/1387014

… @“JR 01” ? @Superstargames ?

what level?

@seamothmaster45 test Level 1

Well for one, your portals are solid objects, make them not solid but have collisions.
And second, You have the collisions. Portal B collision is suppose to be on top and Portal B collision on bottom. Thats like saying to go to portal a after colliding with portal a.

Also because the repeat delay is wonky with collision with non solid objects, leave the repeat to 0 and try this:
2020.04.10-21.24_01

It’s not working @“JR 01” Could you check it and see what I may have missed or gone wrong.

The switch is turning of before it outputs, but I have a fix for that.
I also forgot to mention to put the timer on 2.

Also again, Portal a collision is on bottom and Portal b collision is on top.
After fixing all that, it should work.

2020.04.12-02.36