I'm making a top-down game where a player controls a car.
I want to include teleporter entrance and exit tiles in the game - The player drives over the entrance and gets teleported to the exit.
I got it working so far with 1 teleporter by changing the car's x and y position to match the teleporter exit when it overlaps an entrance, but if I add more entrances & exits, all the teleporter entrances send you to the same exit.
Is there a way I can 'link' each entrance and exit together, so that when the player overlaps an entrance in a pair, they get sent to that corresponding exit?
Thank you in advance!
Develop games in your browser. Powerful, performant & highly capable.
I guess you can link them using an instance variable. So the entrance and exit have the same value at that variable. When player pass through an entrance with the variable equal to 0, he gets teleported to the exit with the variable equal to 0.
Ok, I tried it again and got it working. I used a local variable inside the event to check the IID of the Entrance, and then I set the vehicle's position to the Exit that matches that IID. Thank you!