0 Favourites

How do I Move Player to new layer and set position.

  • I've already set the player to move to a new layer on button press and when collides with a door, but when it happens, the player is underneath the next layer in question.

    I also experimented with setting the position (Or, teleporting, in my mind.), so maybe I could just make all the rooms in one layer, but it doesn't seem to work every time I try to use the 'set position' in any context...

    For the re-position I've tried,

    Player - On collide with Space down, set player position.

    Anyway, doesn't seem to work and its hard to find a tutorial on anything.

    I'm trying to make a game that's sort of like a life sim, but heavily exaggerated with guns, enemies, and different forms of game play. Its sort of like the life sim of the 8 bit era. Most of the game is exploring the environment with 4 - way movement. But, once you get out of the initial town, the game will turn into a 2D platformer with random events breaking it up like oergon trail. But once in a town or event and its 4 way movement again.

    Anyway, right now I'm just working on the house the player lives in, and then maybe the first over world town.

  • Maybe try using a Player: Move to top of layer (z-layer). Although changing layers does that inherently...

    Try building a capx to text exactly your issue. If you can rebuild it, it will give you insights into the mechanics at work behind the scenes. This general practice has helped me fix many bugs in my game (in fact, I have an entire folder filled with test capx files).

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Capx?

    Elaborate.

    Now, set position is working, but the player is still underneath the layer.

  • justintime0185 Capx is just a Construct2 project saved as a single file.

    you say you are already moving the player to a new layer... if you are sure he is on the correct layer, then try setting him to the top of the z-order as well... if he is still behind something, then those objects are not on the layer you think they are (or the player isn't).

  • Capx?

    Elaborate.

    Now, set position is working, but the player is still underneath the layer.

    Oops, sorry, I forgot not everyone uses the Windows extensions visible options.

    Yea, like AllanR says, there are Z-layers within each layer and that arranges sprites within a layer, so moving to top of layer should work too, but moving sprites between layers automatically puts them on top the Z-layer of the target layer.

  • Yeah I tried all that. Didn't work. I think it was some sort of glitch. Anyway, started a new projected and have learned a lot more.

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