Why is my player disappearing when I move between layouts?

0 favourites
  • 7 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • I've made a simple 'test game' with 9 rooms (1 layout per room). The player starts in the center room, and taking any of the 4 exits teleports him to the appropriate room (collision with an invisible object triggering an event that changes either your X or Y coordinate to the opposite side and then does the layout switch). There's just one problem... The player doesn't appear in the next room! Or if he's appearing, he's invisible. Both the player and his sprite are set to 'global', so I'm not sure what's going on.

    Here's the capx:

    http://www.filedropper.com/zzttest_2

  • I tried adding an "on start of layout, create player object on layer 0 at 318, 318" to the universal events sheet. No luck. :X

  • Your layers are a mess. The Player sprite is on the Object layer, but that doesn't exist on the other layouts. You have other layouts with layers in different orders, with different transparencies. Your bottom layer should generally be not transparent and your background. All other layers should be transparent. You've tricked the first layout's Art layer by using white as the background colour, for the Multiply effect to work, but it's black for the others, so it blocks the layers underneath.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What do you mean by 'it blocks the layers underneath'? The multiply effect seems to be working correctly... Also, just having the bottom layer as black and non-transparent was creating this extremely strange issue where the player's sprite was creating a 'trail' everywhere it went.

    Anyways! I cleaned up/standardized the layers (for at least N S E W, haven't implemented the diagonal corner rooms yet b/c I want to get the basic interaction working), implemented a standard system of variables for where to spawn the player on each map... and it's still not working.

    Capx: http://www.filedropper.com/zzttest_3

  • I've cleaned up N & W, as I suggested. The multiply effect only worked on the first layer as you set that layer's background to white. If it's black, like every other layout, then it fails.

    If you are going to create the player, it can't be global, and you have to delete any default objects.

  • Update: I built a simple version (single layer, simple tilemap, etc.) and nothing goes wrong on that one. Not sure what the difference between the two is... http://www.filedropper.com/simplezzttest

    Edit: I spoke too soon! Thanks for doing that, will investigate to see the difference between N/W and S/E to see what's going on there. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Are you sure your player is not on the layer below background, so it is maybe hidden by background?

    Try to create new layer on top of every layout (sall it "player") and then when you create player put it on that layer? (you can refer it by name with quotation marks, like "player", not just by number)

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