The instance being inspected was destroyed?!?!?

0 favourites
  • 5 posts
  • I was making a store for my game where you could customize your character through animation frames. This is what I did: On touched "spr_buy" => Set instance variable of "spr_player" to 1. Then after this, in the actual game part event sheet I put this in this: If spr_player instance variable = 1 => Set animation frame to 1. This wasn't working so I tried to debug my game. When I went to the store and bought the customization the instance variable did change to 1 but when I clicked the back button in the store to go back to the actual game the debugging panel said this: The instance being inspected ('spr_player' UID 35) was destroyed. Why?

  • Are your shop and game on same layout? Or they are two different layouts?

  • Two different layouts shinkan

  • That's the reason. Objects are destroyed between layouts. Only global objects are stay the same. You can make your object global, so it will not be deleted on switching layouts. But for that kind of shop customization I would use array or dictionary, or even global variables if you have only few modifications for character.

    Then if you change something in the array it will stay the same on all layouts until you change this value to something else.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • shinkan Thank you very much!!!! The rest of my game was complete except for the store. Now I can fully finish it

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