UnionASync Doing Nothing

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I Want To Make It So A Sword Can Cut Pieces In Half Around Random Pivot

  2. What is the issue?
    It Doesn’t Union And There’s No Error
    image

  3. What solutions have you tried so far?
    I tried rewritting the code 2 times and developer

script.Parent.Blade.Touched:Connect(function(hit)
	
	local humanoid = hit:FindFirstChild("Breakable")
	if cooldown == false then
		cooldown = true
		local hitclone = hit:Clone()
		local hit = game.Workspace.TestWall
		local hitclone = game.Workspace.TestWall:Clone()
		hitclone.Position = hit.Position
		print(hitclone)
		hitclone.Parent = game.Workspace
		hitclone.Color = Color3.fromRGB(255, 0, 0)
		local negative = game.ReplicatedStorage.CuttingZone:Clone()
		negative.CutPivot.Orientation = Vector3.new(0,0,math.random(1,90))
		negative.CutPivot.Position = script.Parent.Parent.HumanoidRootPart.Position
		
		negative.NegativePart1.Anchored = true
		negative.NegativePart2.Anchored = true
		negative.NegativePart1.Transparency = 0.5
		local negative1 = negative.NegativePart1
		local negative2 = negative.NegativePart2
		negative.CutPivot.Parent = game.Workspace
		negative.NegativePart1.Parent = game.Workspace
		negative.NegativePart2.Parent = game.Workspace
	
		negative:Destroy()
		
		
		hitclone:UnionAsync({negative1,hitclone})
		
		
		hit:UnionAsync({negative2,hit})
		
		cooldown = true
		
		wait(10)
		
		cooldown = false
	end
end)

Thats because union async returns instances and doesnt just paraent them to workspace

local union1 = hitclone:UnionAsync({negative1,hitclone})
local union2 = hit:UnionAsync({negative2,hit})
union1.Parent = workspace
union2.Parent = workspace
1 Like

Thanks it worked I looked at unionasync page again and realised I also had to remove the old parts but also cuz it wasn’t in workspace so thanks again.