Hey,
I have two entities. Both Entities have the self:SetTrigger( true ) set in the Initialize function. Both Entities spawn perfectly However when I touch both entities together it does not detect it. I’m stumped to why this would occur. The entity will detect me standing on it, props ect. Just not the other entity.
Entity1:
function ENT:Initialize()
self:SetModel("models/props_c17/furnituresink001a.mdl" )
self:PhysicsInit( SOLID_VPHYSICS ) -- Make us work with physics,
self:SetMoveType( MOVETYPE_VPHYSICS ) -- after all, gmod is a physics
self:SetSolid( SOLID_VPHYSICS ) -- Toolbox
self:SetTrigger( true )
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
function ENT:StartTouch(ent)
print("We were touched by" .. ent:GetClass())
print(ent:GetModel())
end
Entity2:
function ENT:Initialize()
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_BBOX )
self:SetUseType( SIMPLE_USE )
self:SetTrigger( true )
self:SetModel("models/props_interiors/Furniture_chair03a.mdl")
local phys = self:GetPhysicsObject()
if phys:IsValid() then
phys:EnableCollisions(true)
phys:Wake()
end
end