GMOD Lua SetModelScale and increase prop collision box

So with the following code i spawn in a blastdoor to a map and i increase its scale but the hitbox around the blastdoor still remains small how can i fix this ?


local ent2 = ents.Create("prop_dynamic_override")
	if ent2:IsValid() then
		ent2:SetPos(Vector(-260, 250, 64))
		ent2:SetAngles(Angle(0, 0, 90))
		ent2:SetKeyValue("solid", "6")
		ent2:SetModel(Model("models/props_lab/blastdoor001c.mdl"))
		ent2:SetModelScale( 10, 0)
		ent2:Spawn()
	end

Also, please consider using:

Good luck, man.

Next time, you should consider posting in the “Problems that don’t need their own thread.” You could get faster support there.

Thanks for the info now i am getting errors.

Complete script


hook.Add("InitPostEntityMap", "Adding", function()

	local ent2 = ents.Create("prop_dynamic_override")
	if ent2:IsValid() then
		ent2:SetPos(Vector(-260, 250, 64))
		ent2:SetAngles(Angle(0, 0, 90))
		ent2:SetKeyValue("solid", "6")
		ent2:SetModel(Model("models/props_lab/blastdoor001c.mdl"))
		--ent2:SetRenderMode(RENDERMODE_NONE)
		ent2:SetModelScale( 10, 0)
		--ent2:SetRenderBounds(Vector (-260, 250, 64), Vector (-260, 650, 64))
		ent2:SetCollisionBounds(Vector (-260, 250, 64), Vector (-260, 650, 64))
		ent2:Spawn()
	end
	
end)

Without RenderBounds and Just CollisionBounds “ent2:SetCollisionBounds(Vector (-260, 250, 64), Vector (-260, 650, 64))”, I get no errors but it does not work it still has the blastdoors default collision hitbox if i walk into it.

If you call


ent2:Activate()

after you call Spawn(), it recreates the entity’s physics object. Of course collisions will still be iffy on the client’s end, but it will at least stop people from getting through.

For some reason adding “ent2:Activate()” Just makes the prop have no collision what so ever.