Need help with GetEyeTrace

[lua]
function SWEP:PrimaryAttack()
local ply = self.Owner
if not IsValid(ply) then return end
if ply:GetEyeTrace().Entity == my_entity then
print( “Yup, it’s workin!” )
else
print( ply:GetEyeTrace().Entity )
end
end
[/lua]

Here is the code in my swep. I look at the entity called “my_entity”, whiched I spawned in using the console. but for some reason, it won’t work. It will just print ply:GetEyeTrace().Entity which says [81] my_entity or something similar.
Any ideas why?

That’s not how you compare classes.
Do “if ply:GetEyeTrace().Entity:GetClass() == “my_entity” then”

Jeez, thanks! You sure are a Lua king.