I’ve got a problem. I know how to set an entity on fire (entity:Ignite), but what about a physobj? I’m making a SWEP that shoots explosive barrels, and I was wondering how I could set them on fire as soon as they are launched. The problem here is, the explosive barrel is a physobj, and so I can’t use entity:Ignite. How might I go about this?
In summary: How can I ignite a physobj? Or, rather, is there an equivelant to physobj:ApplyForceCenter for entities?
Here’s the code for the spawning and launching of barrels, just for reference if needed:
ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16)); ent:SetAngles (self.Owner:EyeAngles()); ent:Spawn(); local phys = ent:GetPhysicsObject(); local shot_length = tr.HitPos:Length(); phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow(shot_length, 3));