How do this with layouts.

0 favourites
From the Asset Store
MM_Preloader
$19.99 USD
Various preloading features. Preload textures of entire layout, custom preloading, etc.
  • How do I make it if a object is overlapping another object and then goes to another layout that object is still overlapping the other object and doesn't disappear, without making the object overlapping the main object global.

  • Instead of making all of these individual posts about going to another layout can you just describe the design of the game? Probably you can create everything in the second layout in advance.

  • I'm making a life simulator game where the goal is to not die, and there are buildings in the game which will lead to another layout which is the inside the building. Im trying to make it where when you pick up items in the game and drop them they stay at the previous layout. So in a nutshell I'm trying to make it so the player can pick up an item and bring the objects to other layouts, but drop them which makes the item stay at that layout.

  • Sounds like you're describing an inventory? Take a look at forum posts on inventories, you can use an array to store items that you pick up.

  • Sounds like you need the persist behavior.

  • Tried using persist but sadly didnt work. What im basically making is a inventory wich can only hold 1 object at a time. It works! Im just trying to figure out how to make it so the objects only appear if brought by the character to the other layouts.

  • Persist behaviour will work for one half of the problem that was leaving the item in the layout. For carrying them over you can store in an array. If it's just one item though maybe you can store the item name in a global variable and in the new layout use 'create object by name' with the variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks I feel like I'm getting closer to my goal! So I tried making it work with a global variable like you said but when I spawn into the other layout it automatically has an apple in the players 1 hand.

  • So the variable is called Item as well a the object? Confusing. Anyway it looks like you've used quotation marks so "Item" is wrong instead just type Item so it uses the variable.

  • Does it stay a number variable?

  • No it's string variable, the idea is that the variable is the name of the item, then you use create object by name.

  • I'm still running into the same problem maybe it has something to do with the upper events.

  • Oh okay. So just change everything back to the object apple, instead of it being in a group?

  • You haven't set the item variable to the item name which is the key part of this logic. You need to set the variable to item.ObjectTypeName when you pick it up.

  • Is this right?

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