• ENT.Touch not being called
    4 replies, posted
Simply, I can't get touch to call when my entity is SOLID_NONE. However, i was told last time to use Entity.SetTrigger and that worked I think. But for some reason, now it doesn't. It is a problem with being solid, as when I set it to SOLID_VPHYSICS ENT.Touch was called when I touched it. Thoughts?
Why would you want to call ENT.Touch when the entity is non-solid? If it is non-solid you can't touch it because, well, it isn't solid.
As far as I know anim entities can only be touched when they are actually physically touched. Last time I had an anim entity with a large trigger area and setTrigger it only got activated when you touched it's physics object. But you can always use ents.FindInSphere
Because I want it to disappear when people pass through it, like a pickup. And I have used ents.FindInSphere, but it's rather expensive and I wouldn't want to call it every think.
You can try ents.FindInBox, it takes less resources. wiki link: [url]http://wiki.garrysmod.com/?title=Ents.FindInBox[/url] You can also make the entity think less often to reduce lag. The below code will make it think every half second. [code] self.Entity:NextThink(CurTime()+0.5) return true[/code] wiki link for NextThink: [url]http://wiki.garrysmod.com/?title=Entity.NextThink[/url]
Sorry, you need to Log In to post a reply to this thread.