ENT:Touch will change bool but ENT:EndTouch will not.
1 replies, posted
So I'm trying to have a bool while my entity is inside of a trigger ("lamp_trigger")
it sets self.Lit to true but leaving will not self.Lit to false
function ENT:Touch(col)
if col:GetClass() == "lamp_trigger" then
self.Lit = true
end
end
function ENT:EndTouch(col)
if col:GetClass() == "lamp_trigger" then
self.Lit = false
end
end
That's because entities marked as triggers by SetTrigger do not generate touch events on other entitites.
By this I mean your lamp/light will have no idea it touched a trigger, due to the nature of how triggers work.
The trigger will always know what's touched it, though.
Sorry, you need to Log In to post a reply to this thread.