Shadows disappear when setting multiple parts cframe very fast

Hey guys, I’m scripting a “barrage” skill (multiple punches at high speed), and it works but the problem is that nearby shadows disappear each time i use this skill.

So how it works is that each 0.02 sec i clone a model which is in workspace, which i set the cframe of the primary part (linked a second part inside the model ) each 0.01 sec until it reaches a final cframe and gets transparent, then i wait for the player to release a key and at this moment all parts cloned gets destroyed() , but for some reason shadows disappear when parts move until the model gets :destroyed()

Here is what happens :
shadow disappears

one thing that did fix this issue is changing the shadow technology in lighting to “compatibility” or “voxel” but it just doesn’t look great so i really need to use “Shadowmap”.

Does any one have an idea to fix this issue ? i don’t want to use any other shadow technology than shadowmap.

Thanks

Could you show the code?

Ok so when a player press a key this happens:

local function QuadraticBezier(t,p0,p1,p2)
			return (1-t)^2*p0+2*(1-t)*t*p1+t^2*p2
		end
		--smokes particles
		local smoker = game.ReplicatedStorage.objects.effxs.gatsmoke:Clone()
		smoker.Parent = workspace.particles
		local w  = Instance.new("WeldConstraint",smoker)
		
		smoker.CFrame = hrp.CFrame
		smoker.Position = hrp.Position + smoker:GetAttribute("const") + hrp.CFrame.LookVector * smoker:GetAttribute("multiplyer")
		
		w.Part1 = smoker
		w.Part0 = hrp
		-- trash folder to be deleted when everything is done 
		local newparent = Instance.new("Folder",workspace.particles)
		newparent.Name = "dstrybl"..plr.UserId
		
		local function funclooper()

			local n = math.random(0,1)
			if n == 1  then
				n = -1
			else
				n = 1
			end
			
		
			local Part0 = hrp.Position + hrp.CFrame.LookVector * 2 + hrp.CFrame.RightVector * math.random(0,4.5) * n + Vector3.new(0,1/math.random(-10,10),0) * math.random(0,2)
			local Part1 =hrp.Position + hrp.CFrame.LookVector * math.random(4,7) + (hrp.CFrame.RightVector * math.random(1,5) * n + hrp.CFrame.RightVector * 1/math.random(1,10) * n ) + Vector3.new(0,math.random(-5,5),0) 
			local Part2 = hrp.Position + hrp.CFrame.LookVector * 10 + (hrp.CFrame.RightVector * math.random(0,2) * n + hrp.CFrame.RightVector * math.random(0,1.5) * n ) + Vector3.new(0,1/math.random(-10,10),0) 
			local model = game.Workspace.refs.gatarm:Clone()
			model.Parent  = newparent
			model.main.CFrame = CFrame.new(hrp.Position + hrp.CFrame.LookVector * 2)

			local inter_PART = model.main

			for t = 0,1,punchspeed do

				local newpos 
				if n < 0 then
					newpos = CFrame.new(QuadraticBezier(t , Part0, Part1, Part2), QuadraticBezier(t + 0.05 , Part0, Part1, Part2) )
				else
					newpos = CFrame.new(QuadraticBezier(t  , Part0, Part1, Part2),  QuadraticBezier(t + 0.05 , Part0, Part1, Part2))
					newpos = newpos * CFrame.Angles(0,0,math.rad(180))
				end

			 	tween:Create(inter_PART,TweenInfo.new(0.010,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut),{CFrame = newpos}):Play()
				task.wait(0.010)
			end
			
			if model:FindFirstChild("main") ~= nil then

				model.main.Transparency = 1
				model.haki.Transparency = 1
			end
			
			
			task.wait(0.020)

		end
		
		
		local looper = coroutine.create(function()
			while true do 
				task.delay(0,funclooper)
				task.wait(punchfreq)
				
			end
		end)
		coroutine.resume(looper)
		local ended = false
		local connect2 = game.Players.LocalPlayer:GetAttributeChangedSignal("gatling"):Connect(function() ---when player releases key this fires
			if ended == false then
			ended = true
			
			game.Players.LocalPlayer:SetAttribute("gatling",0)
				coroutine.close(looper)
				smoker.ParticleEmitter.Enabled = false
				game.Debris:AddItem(smoker,1)
				
				newparent:Destroy() -- deletes all model cloned inside this folder
				
			end

		end)
		repeat task.wait() until ended == true
		connect2:Disconnect()