Simplified way to make something happen a limited amount of times.
sinbot
Member Posts: 232
I have an actor that spawns 1x and is then collected with playable actor. Actor spawns a 2nd time right after. After this second time I need the actor to not spawn any more and a new game level attribute activate (ie. lock door opens). What might a straight forward way be to program this? Using a numeric attribute? Appreciate if someone could post an example or direct me to a tutorial that is related.
Comments
Make an integer attribute called game.spawnCount. Leave its value at zero.
In spawner actor
When attribute game.spawnCount<2
Spawn actor [collectable]
Change attribute game.spawnCount to game.spawnCount+1
When attribute game.spawnCount=2
Change attribute game.lockDoor to true
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
thank you!