Is it possible to modify enemy nameplates when in combat?

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

I don’t think you can do that, sounds like it would be too easy to automate things with this function (like set nameplate scale to 999, so player can click on any point to select it). You can probably manage to alter its graphics (like make it look bigger, but clickable area will stay the same).

Yeah you’re right wit the clickable areas - I did anage to kind of get it working how I need though

I set the opacity on plate.UnitFrame.HealthBarsContainer and plate.UnitFrame.name to 0.1

Rather than the plate object itself which works to make them faded, then I set the frame strata for the visible plates to high so they appear in front so now when I have a huge pack of mobs and a priority cast happens, all the other mobs plates fade out and drop ehind it so I can click it easily