Hi,
I’m working on an addon to modify the nameplates of enemies when they cast certain abilities. The goal is to enlarge the nameplate of an enemy when they are casting a tracked spell from my list.
So far, I have this function to update the nameplates:
local function UpdateNameplates()
– Iterate over all nameplates
for _, plate in ipairs(C_NamePlate.GetNamePlates()) do
local unit = plate.namePlateUnitToken
if unit then
– Check if this unit is casting a tracked spell
if activeCasts[unit] then
– Make the nameplate larger for casting units
plate:SetScale(2.0) – Increase the scale factor (adjust as needed)
print(“Unit " … unit … " is casting a tracked spell. Nameplate made larger.”)
else
– Restore normal size for non-casting units
plate:SetScale(1.0) – Restore the original size
print(“Unit " … unit … " is not casting a tracked spell. Nameplate set to normal size.”)
end
end
end
end
The print statements correctly log the name of the enemy casting a tracked spell, so the spell detection is functioning properly.
The nameplates should become larger for enemies casting a spell from my list but nothing happens
I have also tried to :hide() the frames and set alpha to 0.2 but niether of those wored either so I feel like I’m missing something obvious as to why nothing I try will modify the nameplates