Rotating a PhysicsInitBox

So in the gamemode I’m working on there’s a tool that creates invisible walls from 3 given points, as shot by the toolgun. It creates it with PhysicsInitBox. But the problem is that this box doesn’t seem to rotate correctly with the created entity. I can pick it up with the physgun normally and the render.DrawBox that draws it when in Creative Mode rotates as well, but after rotating and placing it back down, the physics just appear to become buggy pushaway. Obviously this is because the PhysicsInitBox creates a world-aligned box physics object, but my question is, is there some way to make this work just fine with rotation? Maybe something that “releases” this physics box into just a normal 3D box like any model? Or maybe do something completely different from PhysicsInitBox?

show us some code, it’s hard to understand what you’re talking about otherwise

It isn’t so much to do with the code I made for it as my question isn’t about what I am doing wrong, but rather how I could do a certain thing. But if you want it anyway, here’s the code I use to create them:

[lua]function Mapping:CreateInvisibleWall(vec1, vec2, ply)
local wall = ents.Create( “invis_wall” )
wall:SetPos( vec1 )
wall:PhysicsInitBox( Vector(0,0,0), vec2 )

local phys = wall:GetPhysicsObject()
if IsValid(phys) then
return wall


What the problem is, is that when it rotates, its physics become really buggy (almost becomes randomly either pushaway or glue or not even solid when walking through). What I want it to, is to make it work like any box-shaped model and have its physics follow smoothly. I’m not sure this is even possible.