How do I Display enemies.count

0 favourites
  • 4 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • I know this sounds simple, but for some odd reason, my sprite fonts wont display the correct enemy count on screen...

    Im doing a simple on Enemy create or enemy destroy, display the enemy.count in text. It doesn't register if I destroy the first enemy, so when theres 1 left, it says there's 2 left. What's even more odd is if I have it update text 1 second after the creation of destruction of an enemy object, it refreshes to say there's 0 enemies left This is happening for any objects I try to display their count on.

    The family is "enemy" so there are multiple objects that are a part of it, but it should still display properly.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's a catch-22. In order to call On destroyed, it still needs the object to call it on, so it hasn't actually been fully destroyed yet. Put a Wait 0 ahead of the Set text, and it should work.

  • It's a catch-22. In order to call On destroyed, it still needs the object to call it on, so it hasn't actually been fully destroyed yet. Put a Wait 0 ahead of the Set text, and it should work.

    I tried that before as well. When I put wait 0 seconds, it updates to show the count as 0 enemies

  • You'll have to provide a sample. The quick sample I did worked.

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