I made it so when you spawn a prop and move it around, it freezed automatically when you drop it. I figured it would be easier for builder, however, I’ve encountered some problems.
- The props move underground when you physgun them, almost like they have no definite shape when being moved.
- They always leave behind some sort of invisible prop, it’s strange, if I move around a fence, I will run into invisible props when moving around and it will make the sound of hitting a fence.
- Players always somehow get glitched into them and get stuck.
Now I’m not sure if it’s the way I’m creating them or if it’s the way I’m freezing them, but I need some help.
Creating:
[lua]
local ent = ents.Create(“prop_physics”)
ent:SetModel(tbl.Model)
//setting pos and other bullshit, removed
ent:Spawn()
ent:Activate()
ent:SetHealth(tbl.Health)
[/lua]
Freezing:
[lua]
function Freeze( ply, ent )
ent:SetMoveType(MOVETYPE_NONE)
end
hook.Add(“PhysgunDrop”, “Freeze”, Freeze)
[/lua]
Any help is much appreciated.