Unable to rotate Grouped objects to right rotation

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

To rotate a model you can so something like this.

rotation = CFrame.Angles(0, math.rad(90), 0)

modelCFrame = model:GetPrimaryPartCFrame()

model:SetPrimaryPartCFrame( modelCFrame * rotation )

Try

local GlassPos = IsGlass.Parent.Position
				local GlassCFrame = IsGlass.Parent.CFrame
				local BrokenGlass = game.ReplicatedStorage.BrokenGlasses.BrokenGlass:Clone()
				BrokenGlass.Parent = game.Workspace
				BrokenGlass:PivotTo(GlassCFrame)

By creating a new CFrame that only has the Position of the unbroken glass model, you’re deliberately throwing out the rotation information. Simply using the same CFrame should do the trick.

1 Like

yep, this fixed it, thanks for the help

1 Like