Question by
black_sheep · Jan 05, 2018 at 03:20 PM ·
raycasttransformfixedupdatelife
Enemy is loosing life when he's gun is shot
So, every enemy has a gun to shoot which is a transform.child of the enemy. Therefor, when i shoot the gun, the enemy looses life. That wasn't much of a problem until now. I've got an enemy who has a shield, and he LOOSES life when he's shield is shot.
I'm thinking of writing a separate script for the shield. Changing the shield's position on FixedUpdate(), putting it on the enemy's hand. Since it's not a child of the enemy, he won't loose life. But that doesn't seem like the best way to handle it. I've come to ask for any advice.
Comment
Is the "lose life" happening as a result of a collision? Have you considered using different physics layers for various enemy components?