So I have this system in a game I’m working on which teleports a pre-made broken glass model into the location of a not broken glass part, it teleports fine but the rotation is the problem, the rotation won’t change and I have no clue how I can go about changing it, can anyone help?
Code:
if IsGlass then
if IsGlass.Value == true then
local Health = IsGlass:GetAttribute("GlassHealth")
if Health <= 0 then
local GlassPos = IsGlass.Parent.Position
local GlassPosCFrame = CFrame.new(GlassPos)
local BrokenGlass = game.ReplicatedStorage.BrokenGlasses.BrokenGlass:Clone()
BrokenGlass.Parent = game.Workspace
BrokenGlass:PivotTo(GlassPosCFrame)
IsGlass.Parent:Destroy()
else
IsGlass:SetAttribute("GlassHealth", Health - 1)
end
end
end