How do I make both players teleport simultaneously?

0 favourites
  • 4 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • I am making a platformer where two players with opposite gravity go through a number of scenes from by teleporting from the end of the scene to the beginning of the next one. So far the code for this seems straightforward. I have a portal sprite that when overlapping with one of the two players moves the camera sprite to the next scene and teleports both players as well. However, my code makes it so that only the player that goes through the portal gets teleported. I have no idea why this is.

    Layout - the scenes are lined up horizontally

    First scene. Both players on opposite sides of a line.

    Second scene. Top player went through their portal and got repositioned to the next scene. Bottom player left behind.

    My code.

  • Instead of using "is overlapping" use "on collision with".

  • Instead of using "is overlapping" use "on collision with".

    Yeah that did it, thanks! I don't understand why, but I'm happy it's working now!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Is overlapping works every tick. As this is an event that you want to happen once only you should use a trigger, in this case "on collision with". This will only be triggered once when the conditions are met. Because you are checking a position, and changing the position in the same tick it can cause issues with the is overlapping condition.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)