- Home /
Help ! I have an enemy script which is working totally fine but when I duplicate that enemy even manually in inspector and play unity editor then both player isn't working properly .
Detail : Enemy Script which has features like moving,chasing,shooting etc . When single enemy is placed in hierarchy it works all fine moving chasing shooting all is great . But when I cloned that object and play the game then movement and chasing towards player is fine but when both shoots on target then one is shooting again & again and the other is keep on playing reloading animation which is after 10 bullets. After shooting 10 bullets the code leads to reload the gun when it first reload both enemies cant detect that reloading animation turns false or true. As i mentioned and the same code works when the enemy is single . What is that any idea ? I have also change my code but whenever the more enemies occur some problem in the code appears. Note : Shooting Method is from Enemy Animation Event
This seems to be a reference problem. If you duplicate so.ething, some references may be duplicated so the same trigger is acting on both clones (no one trigger pee clone)
But I Dont think so because i m referencing line animator = getcomponent(); so the animator should be the one who is the component of this gameobject.
Your answer
![](https://koobas.hobune.stream/wayback/20220612190100im_/https://answers.unity.com/themes/thub/images/avi.jpg)