Having a normalized trace keep the same angle after duplication

Alright, so I’m trying to have a tool that, when left-clicking a prop, sets the surface you hit be determined as “up.” It gets this using tr.HitNormal. It worked fine for a while, but now I want to add duplicator support. Unfortunately, when you duplicate it and don’t keep it at the same angle as the original, it keeps the same “up,” irrelevant to the angle of the prop.

^The top picture is the original, the bottom picture is after duplication.

[lua]
– New function for applying the hull (used for duping)
function ApplyHull(ply,ent,data)
local up = data.Up:Angle()
local _debug = ents.Create(“prop_physics”)
_debug:SetModel(“models/Items/AR2_Grenade.mdl”)
_debug:SetPos(ent:GetPos())
_debug:SetAngles(ang)
_debug:Spawn()
_debug:SetParent(ent)

duplicator.StoreEntityModifier(ent,“ghd”,data)
return true
end
duplicator.RegisterEntityModifier(“ghd”,ApplyHull)
–Designate Hull
function TOOL:LeftClick(tr)

local gravhull = ApplyHull(self:GetOwner(),ent, {

Up = tr.HitNormal,
} )

return true
end
[/lua]

I’ve attempted using WorldToLocalAngles and LocalToWorldAngles, but they didn’t seem to work.

Bump.
I still can’t figure this out. I feel like this should be really easy.