Originally Posted by Duugu
The if clause has the same result for every single nameplate. Because you're requesting a general aggro value and not the value for the actual namplate unit (I'm not sure what UnitThreatSituation("player") does reaturn. But whatever it is ... it's the same value for ever single step in you loop.)
|
UnitThreatSituation("player") without a second unit will return information based on the unit the player's threat is highest against. If you're on the threat table for 5 mobs, but only have aggro on 1, then it will indicate that you have aggro. To get information about your threat vs. a specific unit, you need to pass a second unit, eg. UnitThreatSituation("player", "target")
However, this only works for units with a current (and known) unit token, so it isn't a suitable solution for nameplates. Use the solution posted by Oppugno instead to get the information from the nameplate's default threat region.