Hi there!
I have an enemy with an instance variable. If you kill the enemy, the enemy dies. However, if you kill the enemy and the instance variable is set to 1 for that specific enemy, I want it to spawn a coin when it dies.
I've tried this:
Player collide with enemy and instance variable is set to 1 - spawn coin.
And I've also tried this:
On enemy destroyed and instance variable is set to 1 - spawn coin.
The problem is that when I do this, even the enemies with the instance variable set to 0 also spawns a coin when they die.
What is the best way to make sure that only the one with the instance variable set to 1 will spawn a coin when destroyed/died?
Thanks in advance,
Tommy