Textures on Union are getting stretched, [HELP]

[Please help as this is a HUGE part of my game.]

Hello. I am making a Roblox game that involves room generation, and to generate the rooms, I basically put in a base room. Then I cut out a hole somewhere on the wall for a door frame, and this is where it breaks. It does cut out the hole in the wall, but the textures that were on the union before the union was made get stretched badly when I reply them. Sometimes they get stretched, sometimes they don’t for certain walls.

So, before I make a union, I save all of the textures for that part. Then I create the union, then I apply the textures back onto the new union. PLEASE note that this is all done within a SERVER-SIDE script.

Here is the before, and the after.

Before door frame is generated The purple part is the door frame NEGATE part that cuts out a hole, every wall has these, and there is random chance it will generate a room there.

After Changing the textures scale doesn’t work, deleting the texture and putting a new one breaks it even more, what is going on??


Script

								local partTextures = {}
								for d, v in pairs(part:GetChildren()) do
									if v:IsA("Texture") then
									partTextures[d] = {v.Texture, v.StudsPerTileU, v.Face, v.Transparency, v.Color3}
									end	
								end
								--This area saves the textures.
								
								
								local newThing
								local success, erromessage = pcall(function()
									newThing = part:SubtractAsync({newExit}, Enum.CollisionFidelity.PreciseConvexDecomposition, Enum.RenderFidelity.Precise) --Makes a union
									newThing.Parent = currentRoom.Model--Puts it in the model
									table.insert(newParts, newThing) --Inserts the new parts into the table
									part:Destroy() --destroy old wall, because union is a whole new part
									newThing.UsePartColor = true --Change some settings
								end)
								--This area creates the union with the newExit which is the hitbox. Then it destroys the old part, and just leaves the newly unioned part.
								
								

								--Load the textures back on from table of saved textures,
								for i, v in pairs(partTextures) do
									local c = Instance.new("Texture")
									c.Texture = partTextures[i][1]
									c.StudsPerTileU = partTextures[i][2]
									c.StudsPerTileV = partTextures[i][2]
									c.Face = partTextures[i][3]
									c.Transparency = partTextures[i][4]
									c.Color3 = partTextures[i][5]
									c.Parent = newThing
								end