0 Favourites

Move an object to another layer

  • Hey guys!

    I'm working on a top-down action game (kinda like the old GTAs :) ).

    I wanted to implement that the player could enter buildings, so I made an extra layout for every building.

    In that building I spawned an instance of the player. But when I want to go back I found no proper way to tell the game where the player was before entering the building. He is always spawns at his start position of the layout.

    I had the idea that I could create global variables for every building wich include the spawn-position next to the building. But that didn't work...

    Mabe you guys have some ideas. :)

    I hope this problem for Construct 2 wasn't posted already, but I didn't find anything in the FAQ or using the search.

    spinz89 :)

  • global number x = [insert the starting X position]
    global number y = [insert the starting Y position]
    On start of frame
      -> player: set X to x
      -> player: set Y to y
    On entering a bulding
      -> set x to player.x
      -> set y to player.y
      -> go to layout building
  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • What a great idea thanks! :)

    So simple but I couldn't work something like this out... :-/ :)

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