View Single Post
01-19-21, 04:55 PM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Maybe there is similar situation that UnitLevel has.

https://wow.gamepedia.com/API_UnitLevel
'Note that the value returned by UnitLevel("player") will most likely be incorrect when called in a PLAYER_LEVEL_UP event handler, or shortly after leveling in general. Check the PLAYER_LEVEL_UP payload for the correct level.'

Maybe with UnitHealth you need to use the UNIT_HEALTH event and check the value at that point ? You've not confirmed if you are using UNIT_HEALTH to track health changes. It may be that if you call UnitHealth() and then the health is updated, the screen may show the new value but UnitHealth grabbed the previous value.
__________________
  Reply With Quote