Destroy spawned actor
echoink
Member Posts: 11
I have actors (coins) spawned just off screen, and they then scroll onto the screen at random intervals and locations.
When my hero collects them, the purse count attribute increases successfully such that his image changes when he's picked up 10 of them, but how do I destroy the coins? I edited the coin prototype and added a rule:
- destroy if it collides with character type hero
but when I set this rule, the coins destroy themselves after they've scrolled about five pixels onto the screen. They show up for just a second and vanish.
When my hero collects them, the purse count attribute increases successfully such that his image changes when he's picked up 10 of them, but how do I destroy the coins? I edited the coin prototype and added a rule:
- destroy if it collides with character type hero
but when I set this rule, the coins destroy themselves after they've scrolled about five pixels onto the screen. They show up for just a second and vanish.
Comments
Change attribute score to score + 1
Delete coin
Do you possibly have them destroying when colliding with another actor?
Need Help? Email Me | Templates | Full Game Source Code
Post a screenshot of your collision rules (instructions in my signature below) and we'll see if something is amiss.
Also, put a Log Debugging Statement inside of the collision rule and watch the Debugger window to see if it appears when the coin gets five pixels into the scene. Does it?
Finally, delete all actors from the scene and re-add them to eliminate the possibility of unlocked instances with their own rules.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User