Container bug?

This forum is currently in read-only mode.
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • I have a container for the player and all his parts. When the player overlaps a door object, I change to the next layout and spawn the character in the new layout through an event. This seemed to work fine, but when I looked at the debugger, it retained the character from the previous layout. I figured then that I should destroy the player object when he exits the layout. When I destroy the player object though, it doesn't seem to destroy everything in the container. When I look at the debugger, I can see that there is only 1 player object but multiples of everything else in the container.

    Here is a cap file:

    If you debug the cap file, move to the right (by pressing D) and fall down the hole. You'll pass one layout and enter another. Look at the debugger and youll see one Player object (only one because im destroying it on exiting the layout then creating it again on the new layout). However, the other objects in the player container don't get destroyed and there are 3 of each: CameraObject, detectorR, detectorL, and Part_Dust. Shouldn't they be destroyed also? Is there a better way to spawn the player per layout?

    Thanks, appreciate any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of creating the player object and all of its detectors on the next layout through events, maybe you should just place another instance of it there in the layout editor? maybe that would solve it? I don't know exactly what you are going to do here, Im assuming you want zelda like scrolling right? well I did that for a platformer but I dont know if that is what you are aiming for.

    I edited your .cap to show you what I'm trying to say. ... evised.cap

  • Thanks for the reply. However that didn't seem to fix the problem. If you still look at the debugger there are multiple instances of the objects, when i just need one. I guess I'm looking to be optimized. Also, Im trying to use events so that if I change the objects in the player container, it will automatically update the other layouts, rather than paste the new objects into 100+ layouts.

  • oh I get what your saying now, its too bad I never use the debugger >.< I always just set my events and then run the layout and see if it works. then again I havent really made more than one layout yet. Sorry bud, I guess you need help from someone with more experience.

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