So, I have a WA I use for detecting the target of specified casts and highlighting their nameplate. The problem I'm finding is that whenever mobs chain cast abilities (for example, any mob that spams the 'shoot' spell) the target does not properly update. The frame of the PREVIOUSLY targetted person will be highlighted while the cast is going off targeting a different player.
EDIT: On more testing, this also seems to apply for a mob that switches target at all. If a mob is being tanked, but they switch target to a new random player to cast some spell, the tank's nameplate will be highlighted rather than the target of the spell.
if ts then
local changed = false
for _, state in pairs(s) do
state.show = false
state.changed = true
changed = true
end
for cloneID, state in pairs(ts) do
if state and state.show and state.destUnit then
s[cloneID] = CopyTable(state)
s[cloneID].unit = state.destUnit
s[cloneID].changed = true
changed = true
end
end
return changed
end
end```
Here's the code I'm using to update the target. Any help is greatly appreciated. If there's some information about the triggers needed I'm happy to provide. Thank you!
?