How do I respawn instances of an object?

0 favourites
  • 3 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • So saying I have a "Troll" sprite and created few instances of it. Now I need to respawn them every time my player kills them.

    But this isn't working. I try to do it with pick by IID. But it only works for one instance. Then I tried creating new spawn sprites for other troll instances and repeat the On Destroyed event but that doesnt work as well. I tried to add another event/sub event pick by unique UID of troll instances but failed.

    Im a beginner so I havent got yet to the point to understand UID/IDD very well and if they change on destroy/respawn.

    I also tried it without a respawn sprite. And it works ok. But it respawns them instantly, which I dont want it. I added the time behavior to troll but then doesnt respawn at all.

    Any help is greatly appreciated.

    Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since you only have one spawner and one timer, with multiple instances of trolls they are restarting the timer all the time.

    You should probably move the Timer behavior to Troll object. When health<=0, instead of destroying this troll, hide it from the screen and start a timer on it for 2 seconds. On timer event, destroy this troll and spawn a new one. Or you can simply move it to spawner position and reset its health (make him alive again).

  • You a wizard, it worked.

    Tho timer behavior on troll did not work. I did it with system wait x seconds. troll on destroyed troll spawn another troll.

    Thank you. Made my day.

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