how I create objects that maintain the hierarchy?

0 favourites
  • 6 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I have an objectbank layout with the game objects, including the player. In the layout of the first phase, when I add the event to create the player, it does not come with the parts I created in the hierarchy. So I'm having to get the object ready in layout 1 with all the objects in the hierarchy in that layout.

    But I wanted to leave the player assembled with the hierarchies in the objectbank layout and be able to create it in all the layouts of the phases by pulling from the objectbank layout. The problem is that when I create the same it does not come with the hierarchies. And when I order to create the object I mark the box to come with the hierarchies.


  • Hello. I still haven't figured out how to create an object in execution time that comes with all its parts (I created a hierarchy and container but it didn't work). I am creating objects composed of several parts, but I am leaving them in the object bank. When I create them in other layouts they don't come with all the parts. How do I do that?

  • Can you share the project you are working on? Or an example that shows the problem?

    From your explanation it should work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi. I created an example of the problem, but I must be really missing something, probably. I created a layout called bank where I placed the player object made up of 3 more parts. I also created an event sheet for the player only. And I created another layout called phase 1, where I put an event to create the object that should be created with the parts. In this layout I also refer to the player events spreadsheet, which is where the player hierarchy creations are.

    I was wondering, should I create these hierarchies in each layout? Like creating a function out of it and calling it in each layout?

    What is really working is putting an instance with all the parts in the layout that I want to appear, then it works. But if I just create at run time without an instance in the layout, I don't create with the parts.

    To summarize the problem: in the stage 1 layout, when I create the player object it does not come with the hierarchy parts. There is no such instance of the player in the stage 1 layout, only on the bank page.

    Follow the attached example.

  • This is not how you do it. You can create hierarchy connections with actions, but you'll have to put them into the same event where you have "Create" action.

    But an easier way is to create connections on the layout - select all sprites, right-click on the parent and choose Hierarchy menu. I fixed your project:

  • Thank you very much. You really helped me a lot, this group is amazing and we can learn everything we want, I believe. I had actually read about making hierarchies in the layout itself, but I didn't think it would make a difference from action by event. In my case, the action of creating the hierarchies by event only worked if I placed an instance of the object in the layout. But that way the hierarchy really stays anywhere and still saves events. Very effective. Thanks.

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