As the title suggests, my entity...
CreateCloakEntity = function(self)
if myDebug then WARN('CreateCloakEntity') end
ent = import('/lua/sim/Entity.lua').Entity({Owner = self,})
ent:AttachBoneTo( -1, self, 'ura0206' )
ent:SetMesh(self.MeshCloak)
ent:SetDrawScale(self.MeshScale)
ent:SetVizToFocusPlayer('Always')
ent:SetVizToAllies('Always')
ent:SetVizToNeutrals('Never')
ent:SetVizToEnemies('Never')
self.Trash:Add(ent)
end,
Is created and attaches to the parent unit just fine. However later on when I need to dismiss the entity, I'm having problems removing it.
for k, v in self.CloakEntity do
v:Destroy()
end
The "self.CloakEntity" is the Global table used to save the entity within the parent unit. Yet Destroy() neither flags an error nor removes the entity.
Any ideas or suggestions would be much apricated.
Side note: Looking inside of /lua/sim/Entity.lua I see that It's with a few basic functions that are mostly undefined / blank. Is it possible that's why the entity is not destroyed?
Resin