Answers

Losing power up bool value

0

I'm just about finished on a 2D shooter game and everything is working perfectly except for my score multiplier power up. I know the bool value is being set to true when the player picks it up but when I kill an enemy the value is false...not sure what's going on

here's my code for the power up private GameObject objPlayer; private AIscript scriptAI;

When the player picks up a multiplier, it sets isMulti = true in the player's instance of AIScript. When the enemies die, they check if isMulti is true in their own instance. When they die, they need to check the instance on the player.

removeMe() is a function in AIscript that gets called from Update if the health of either the enemy or the player is <= 0. sorry if this was unclear, I removed parts of the code to keep it less cumbersome