Spawning destroyed actors
ApacheG
Member Posts: 8
Hi all, I'm having a little issue spawning an actor using a random timer.
This actor (Monster) spawns at the right of the screen from an invisible spawner actor and moves left towards my (hero) character.
It works fine if I allow the Monster to run off screen since another will spawn on the right a few seconds later. However if I destroy this character with my hero, no more spawns appear on the right.
How do I respawn a destroyed actor?
Here are some screenshots for reference:
Spawner:
Monster:
Thanks.
Comments
Sounds like you want just one monster at any given time.
I would make an integer call it monsterCount and leave it set to 0 now when you spawn a monster change this integer to 1 and when you destroy or it goes off scene change it back to 0.
Now do a rule if game.monsterCount = 0 spawn monster after random x seconds.
Out of the office ATM but if you need a demo shout.
Darren.
Actually I would like it to be possible to have more than one monster on screen at once since I have an animation for a "corpse" once it's health reaches 0 which I would like to be picked up for points.
Would this require a second actor for the corpse?
Edit-
Ok, I think I may have figured out what is happening. I made it so when my monster is killed he turns into a corpse using an animation, from then on the spawner keeps spawning corpses instead of the live monster.
Is there a way to keep spawning the live monster while leaving the previous monsters corpse to be picked up by the player?
Thanks.