Hi i created brick brekaer game and weapon it work great. But i dont want to player have always a weapon, i want to create a script so when player destroy every 20 brick, from top will be spawned pickup weapon object. I'm not asking you to make me all of that , just to help me to crate script that will Instantiate weapon object and stick it to player when player pickup weapon object! Tnx in advance!
asked Aug 04 '11 at 06:07 PM
okay, a solution that can be translated into working code. First, counting bricks. You need to have a variable to store how many bricks hit so far. Secondly, you need to check if you have reached that limit.
Lets call it:
Every hit will +1 to this variable.
so you need a function like:
After adding +1 then check if brickHits is above your wanted limit (20)