Looking For Help, Want to Disappear My Original Character frame out of combat

Hi, I’m looking for a way to Fade out my original blizzard character frame when I’m not in combat. iv looked everywhere and can’t find an option for it unless I use ElvUi which I rather not use.

EventRegistry:RegisterCallback("PLAYER_REGEN_DISABLED", function() 
	PlayerFrame:SetAlpha(1)
end)
EventRegistry:RegisterCallback("PLAYER_REGEN_ENABLED", function() 
	PlayerFrame:SetAlpha(0.3)
end)
PlayerFrame:SetAlpha(0.3)

You can paste the code into the website addon.bool.no to create/download it as an addon.

1 Like

awesome it works! i hate to ask but i think id rather it disappears while not in combat, can you write me a code for that! this is exactly what im looking for. also id like if i mouse over it for it to show back up if possible when not in combat

Delete the current addon and paste this code and create/download as a new addon.

PlayerFrame:SetAlpha(0)
EventRegistry:RegisterCallback("PLAYER_REGEN_DISABLED", function() 
	PlayerFrame:SetAlpha(1)
end)

EventRegistry:RegisterCallback("PLAYER_REGEN_ENABLED", function() 
	PlayerFrame:SetAlpha(0)
end)

PlayerFrame:HookScript("OnEnter", function(self)
	self:SetAlpha(1)
end)

PlayerFrame:HookScript("OnLeave", function(self)
	if not InCombatLockdown() then
		self:SetAlpha(0)
	end
end)

Adjust the SetAlpha(0) code to anything between 0 and 1. That will set the out-of-combat visibility from completely transparent to completely opaque.

1 Like

thank you kindly sir