View Single Post
01/10/23, 03:03 AM   #3
wido1234
Join Date: Dec 2022
Posts: 2
Originally Posted by Baertram View Post
If it shows upon loading into the game you have forgotten to set your fighting text control invisible at the start (OnAddOnLoaded)

AvatarIndicator:SetHidden(true)

You currently do this only in your InCombat callback function which is not fired until you first get into combat.
AvatarIndicator:SetHidden(not inCombat)


e.g.
Lua Code:
  1. function Avatar.Initialize()
  2.     AvatarIndicator:SetHidden(true) --add this
  3.  
  4.     Avatar.inCombat = IsUnitInCombat("player")
  5.  
  6.     EVENT_MANAGER:RegisterForEvent(Avatar.name, EVENT_PLAYER_COMBAT_STATE, Avatar.OnPlayerCombatState)
  7.  
  8.     Avatar.savedVariables = ZO_SavedVars:NewAccountWide("AvatarSavedVariables", 1, nil, {})
  9. end
Thank you
  Reply With Quote