Question about timer
I want my enemies to respawn when last enemy is dead.
Currently my enemies spawn instantly when last enemy is dead.
So i put all spawn actor inside a timer of 1sec but now enemy dont spawn when last enemy is dead however if i move spawn command from timer the enemys spawn.
How to make enemy spawn after 1sec when last enemy is dead and why is it not happening when i use timer
Currently my enemies spawn instantly when last enemy is dead.
So i put all spawn actor inside a timer of 1sec but now enemy dont spawn when last enemy is dead however if i move spawn command from timer the enemys spawn.
How to make enemy spawn after 1sec when last enemy is dead and why is it not happening when i use timer
Best Answers
-
MarkOnTheIron Posts: 1,447
A destroyed actor can't spawn something. I modified the demo a little for you. Is that what you were looking for?
http://dl.dropbox.com/u/8244920/testdemo.gameproj.zip -
tatiang Posts: 11,949
@SANDEEP410 The key here is that you need a separate, invisible actor that watches the value of game.ballcount and then spawns the actor when appropriate. That kind of rule should never be on the gameplay actor itself, especially if you are destroying that actor. And one more suggestion: always have the Destroy behavior at the end of your rule or list of behaviors. If Destroy is listed before something else (in your case, Change Attribute game.ballcount to game.ballcount-1), it won't always work because the actor may be destroyed before/at the same time as that behavior attempts to run.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Have you clicked the check box "run to completion"?
http://www.theworksofc.com/wp-content/uploads/2012/05/Timer-Test.zip
I hope it helps.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Heres a pic.
Initially there are 5 balls when last ball is destroyed its supposed to spawn all 5 balls again.
Now when i put that spawn command inside a timer it doesnt spawn,however if i dont use timer it spawns
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
heres a demo test, it doesnt work in here too