Bug on frozen entities

Hi everyone , i have some bugs with this script


timer.Create( 'AlienIsolation_RespawnCrates', 20, 0, function()
    local crates_found = ents.FindByClass( 'item_ai_crate' )
    for i, v in pairs( crates_found ) do
        local pos, ang, mdl = v:GetPos(), v:GetAngles(), v:GetModel()
        SafeRemoveEntity( v )
        local new = ents.Create( 'item_ai_crate' )
        new:SetPos( pos )
        new:SetAngles( ang )
        new:Spawn()
        new:SetModel( mdl )
        new:PhysicsInit( SOLID_VPHYSICS )
    end
end )

when i spawn the entities i froze with my physicsgun and after 20 secs, the entites is unfroze . I try so many differents some ways but it’s doesn’t work.Please someone can healp me . Thank for help

Well obviously they will reset every single thing you manually do to them if you delete the entity and create it again.

This is the function that will freeze the object in place like the physics gun does.

NOTICE THAT IT IS A PHYSICS OBJECT FUNCTION, NOT AN ENTITY FUNCTION.

Also you should really move the




        new:SetModel( mdl )
        new:PhysicsInit( SOLID_VPHYSICS )

Into the ENT:Initialize() which is called when EEntity.Spawn() is called…