Text refuses to Destroy

0 favourites
  • 6 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hi all, been experimenting with a shop system, and I've come up with the idea of invisible sprites that spawn the initial text buttons, and on press destroys the text buttons and spawns new ones.

    The problem I'm having, is that when I press "Shop", all the text buttons EXCEPT "Shop" destroy perfectly and the new ones spawn.

    Here's the capx: dl.dropboxusercontent.com/u/28499111/spacegameShopProblem.capx

    Any ideas why this one refuses to disappear?   <img src="smileys/smiley1.gif" border="0" align="middle" />

    As usual, any help appreciated!

    Edit: Event sheet is the "station" one <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Before I download this, since I've had similar issues in the past, do the following checks:

    Is the event that spawns the text spawning more than once? You may need a 'Trigger Once' condition. You can see how many instances exist through the debugger (it is possible for multiple instances of text to be created and overlapping each other, giving the illusion that the text is never being destroyed even though it is).

    Is the event that destroys the text firing at all? Add an event that destroys something else and see if that other thing gets destroyed. If not, then you know the event that destroys the text isn't firing at all.

    If the event that destroys the text is not firing, start disabling conditions until it fires. You should be able to pinpoint which condition is the problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've set a global variable that only spawns the text on a paticular value, so I don't think it's that. The event that should destroy the Shop text is destroying all the other text, which is why I can't figure this one out...

  • In Event 10 on the Station Event Sheet, disable the first line 'System: wait 0.5 seconds' and it works.

  • I've set a global variable that only spawns the text on a paticular value, so I don't think it's that.

    Your text is spawned every tick that condition is met, so who knows how many instances of the text object exist.

    Add a trigger once while true to the spawning event and all troubles disappear.

  • LittleStain is correct. If you add a debug text and set it to Shop.Count you will see it count up rapidly. Silly me always looking for quick fix :)

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