No physics on a spawned entity


function SWEP:Toss()
	local ply = self.Owner
	local tr = ply:GetEyeTrace()
    if !tr.HitWorld then return end
	if tr.HitPos:Distance(ply:GetPos()) > 128 then return end
	local Views = self.Owner:EyeAngles().y
   	local ent = ents.Create("scanner_sentry")
        ent:SetOwner(ply)
  	ent:SetPos(tr.HitPos + tr.HitNormal) 
	ent:SetAngles(Angle(0, Views, 0))
   	ent:Spawn()
        ent:Activate()
    local entphys = ent:GetPhysicsObject();
    if entphys:IsValid() then
        entphys:SetMass(entphys:GetMass()+200)
    end
ent:SetTrigger(true)
ent.IsTurret = true
        self:Remove()

end


Whenever I spawn an entity with this code, the spawned entity has no physics. And no, this isn’t a problem with the entity itself, just a problem with my SWEP code. Anyone know why?

ent:SetTrigger(true) might be the problem.

Even with SetTrigger removed it has no physics.

Does the server has the model? Does it work if you spawn the entity by other means? Can you post source code for the entity?

Could you please specify what do you mean with “no physics”? Does the entity not fall to the ground or can’t you just not touch it after spawning it?