Freezing SWEP Entities

I’ve managed to find one person that has asked about this on Facepunch, and he didn’t get an answer, so I’m gonna ask again.

Is there any way to permenantly freeze SWEPs in place without having to freeze them each tick?

I’ve tried these three;


local Ball = ents.Create("rb_ball")
Ball:SetAngles(podiumentity:GetAngles())
Ball:SetPos(podiumentity:GetPos()+(podiumentity:GetUp()*60))
Ball:SetKeyValue("spawnflags", "1")
Ball:Spawn()


local Ball = ents.Create("rb_ball")
Ball:SetAngles(podiumentity:GetAngles())
Ball:SetPos(podiumentity:GetPos()+(podiumentity:GetUp()*60))
Ball:GetPhysicsObject():EnableMotion(false)
Ball:Spawn()


local Ball = ents.Create("rb_ball")
Ball:SetAngles(podiumentity:GetAngles())
Ball:SetPos(podiumentity:GetPos()+(podiumentity:GetUp()*60))
Ball:SetMoveType(MOVETYPE_NONE)
Ball:Spawn()

Each of these freeze the SWEP for about two seconds before it’s physics is re-enabled again, and if I use this code below, I obviously don’t even get two seconds of frozen SWEP.


local Ball = ents.Create("rb_ball")
Ball:SetAngles(podiumentity:GetAngles())
Ball:SetPos(podiumentity:GetPos()+(podiumentity:GetUp()*60))
Ball:Spawn()

I am currently spawning the SWEP from concommand, but this happens with any SWEP I attempt to freeze, reguardless of how they are spawned.

The only solution I can find is to freeze it in a Tick function, which I would really rather not do.

Does anyone have any idea why this is and how to overcome it?

Thanks

What do you mean exactly by “freeze” the SWEP? There are several things you could be referring to.

DIsabling it’s motion, so that it can still be picked up by colliding with it, but cannot move itself.

I can’t really think of anything else that freeze could mean, especially since I gave a bunch of examples of me diabling motion.

I’m trying to get the same effect as when you hit the constrain checkbox in hammer, but this is what “Ball:SetKeyValue(“spawnflags”, “1”)” does. If you constrain weapons in your map, when you load it into Gmod, they will have their physics re-enabled after a second or two.