Hey guys, running into a small issue here and I'm trying to find an effective way to resolve this. Upon awake I call the game object to be destroyed after 4 seconds. If the player enters the trigger of that game object he will take damage and a layer collision will be applied to prevent the player from taking more than one hit for 2 seconds at which point I reactivate the layer collision so the player can take damage again. I'm wondering if the reactivation of the layer collision is not taking place because the game object is destroyed before that reactivation is occurring. Anyone have any ideas? Maybe it's something simple. Here is the code. Thanks!
asked Jun 29 '12 at 11:49 PM
Yes the coroutine will stop when the game object it destroyed. Instead make the latter part of the code a separate coroutine on the player and run it there...
answered Jun 29 '12 at 11:52 PM