So i have a script in which i have put the script below in update which means everytime a frame passes it should be fired again and the enemytarget should change to whichever gameobject posses the attack prioritize variable
however even though the attackprioritize changes when its suppose to the enemytarget does not and im not sure why at this point.
Is it possible that more than one enemy as the value of “attackprioritize”? To help identify this, you might want to break out of the for loop after setting the enemytarget to someone with priority. Or else you can put a breakpoint at the start of targetcomplete() (say line 3) and then one on line 8 and see if line 8 hits more times than line 3 in a given pass.
would be extremely rare as the attack value is a float between 1 to the party size and ive compared them before before and they were different the enemytarget only selects its target once but i need it to constantly cycle through the playerlist and see if(player.GetComponent().Attackpriority == attackprioritize) and set it to the enemy target however it is only occuring once
the attackprioritize is definitely changing so the issue seems to be with a lack of cycling through the list
at this time im calling it through a method in update but it is not doing the trick
i put this code to reset the target but again it will not set the enemytarget even though it calls target complete