Entity movetype, no collision problems


function ENT:Initialize()
	self:SetModel( "models/props/cs_militia/militiarock03.mdl" )
	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_NONE )	
	self:SetSolid( SOLID_VPHYSICS )  
end

That is my initialize code, I don’t want the entity moving at all I pretty much want it frozen. Though when I use self:SetMoveType( MOVETYPE_NONE ) it is frozen, but props can be forced through easily with the physgun and self:SetMoveType( SOLID_VPHYSICS ) moves.

Help appreciated, thanks!

You’ll have to make sure the player can’t touch the entity with their physgun since that will unfreeze the entity.

As for disabling the ability to interact with the prop using a physgun or gravity gun, you can use the following method.

First of all, set a name for the entity; this can be anything:


function ENT:Initialize()
	self:SetModel( "models/props/cs_militia/militiarock03.mdl" )
	self:SetName( "WorldRockProp" )
	self:PhysicsInit( SOLID_VPHYSICS )
	self:SetMoveType( MOVETYPE_NONE )
	self:SetSolid( SOLID_VPHYSICS ) 
end

After that, use this function to disable interaction with it using a physgun or gravity gun:


function DisablePhysgunInteract(ply, ent)
        if (ent:GetName() == "WorldRockProp") then
                return false
        end
        return true
end
hook.Add("PhysgunPickup", "DisablePhysgunInteract", DisablePhysgunInteract)


function DisableGravGunInteract(ply, ent)
        if (ent:GetName() == "WorldRockProp") then
                return false
        end
        return true
end
hook.Add("GravGunPickupAllowed", "DisableGravGunInteract", DisableGravGunInteract)

I hope this helped, good luck!