Monday, December 15, 2014

CSG 130: Pick Up/ Destroy Script PT2

Hello everyone.

I realized that my destroy script worked a little too well. It was destroying the pick up item before it had time to play the SFX for the item. I tried adding a timer with the  IEnumerator method on the destroy script but it still wouldn't work. So I decided to go ask Mike about it since I couldn't find any answers on Google. For a second he couldn't even figure out why the IEnumerator wasn't working. So he told me it would be best to get rid of the destroy script all together! Then she showed me how to have tell my pick up script to check the inventory and destroy the item if the item was in the inventory array. Mike is truly a life saver!
Here's the line of code that saved me!

No comments:

Post a Comment