How do I create another instance of a parent object?

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • So I have a parent object with several children objects (the parent object is not part of a family).

    When I create the first parent object, I tick the hierarchy checkbox and it is correctly created with all children objects.

    In the game I need to create this parent object over and over again. The behavior I want is that each time I create a parent, it will be created with its own set of children, independently of any other instances of the same parent object and their children.

    However, when I call the create object action at runtime and create another instance of the parent object, it is created with its children (as intended) AND children from all previously created instances of the same parent object are transferred to the new parent object that was just created... (not intended).

    Any idea why this happens or how to solve this?

    Thanks!

    Tagged:

  • Can you post your code? That sounds kinda unintendet/buggy. Have you tried setting a template?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you using containers? If any of the children is in a container, this may explain why extra instances are created.

  • Thanks for trying to help - turns out I forgot about some old code (from when I was using containers instead of hierarchy) that pinned the children to the parent on creation, which caused the unintended behavior...

    Thanks again and sorry for not noticing

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