hi all,
i'm working on my minimap and i wonder if it's possible to move it with an "OnEvent" sript or something else.
so what it should do is, move say 50px down when i have a target and 50px up when i have no target.
what i've got looks somehow totally wrong
Code:
Minimap:ClearAllPoints()
Minimap:RegisterEvent("PLAYER_TARGET_CHANGED")
Minimap:SetSize(UIParent:GetWidth()*0.12, UIParent:GetWidth()*0.12)
Minimap:SetScript("OnEvent", function(frame, event)
if event == "PLAYER_TARGET_CHANGED" and (UnitExists("target"))
then
Minimap:SetPoint("TOPRIGHT",-UIParent:GetWidth()*0.01,-UIParent:GetHeight()*0.08)
elseif event == "PLAYER_TARGET_CHANGED" and (UnitExists(nil))
then
Minimap:SetPoint("TOPRIGHT",-UIParent:GetWidth()*0.01,-UIParent:GetHeight()*0.02)
end
end)
cant somebody please help or give any direction