• ENT.Touch and SOLID_NONE
    6 replies, posted
I'm trying to make a health/ammo "pickup" for the gamemode I'm making, but the problem is I want the pickup to not be solid. However, ENT.Touch isn't called with SOLID_NONE, so I'm forced to use an ents.FindInSphere in ENT.Think, which is very expensive. Ideas? I don't want to make it solid because when players run into it you hear a scraping noise and you get kind of shifted upward, which is weird.
[b][url=wiki.garrysmod.com/?title=Entity.SetTrigger]Entity.SetTrigger [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] You'll love that function. :dance:
Cool, thanks. So ENT.Touch will get called if anyone touches the hitbox with SetTrigger on, regardless of whether it's solid?
[QUOTE=Entoros;19356882]Cool, thanks. So ENT.Touch will get called if anyone touches the hitbox with SetTrigger on, regardless of whether it's solid?[/QUOTE] Yup
Hi, 4 years after, I think ther is something I missed in this post. I have exactly the same problem for a cube: [LUA]function ENT:Initialize() self:SetModel("models/hunter/blocks/cube8x8x4.mdl") self:SetTrigger(true) self:SetSolid(SOLID_NONE) end local function SpawnFlag() flag1 = ents.Create("flag") flag1:SetPos(Vector(-379.207275, -111.624481, 96.031250)) flag1:DropToFloor() flag1:Spawn() flag1:Activate() end hook.Add("InitPostEntity", "SpawnFlags", SpawnFlag) function ENT:Touch(entity) self:Remove() end[/LUA] I applied the setTrigger method but TOUCH doesn't trigger... I'm sure it's stupid but I don't have any idea... Thanks for the help !
Please don't necrobump old threads. If there's an issue, start a new one.
I thought it was a good idea, I'm really sorry ^^ I'm going to create a new thread ASAP , I just wait if somebody is answering.
Sorry, you need to Log In to post a reply to this thread.