Issues with spawning and rotating projectiles upon death

Hello! I am currently having some issues with spawning projectiles on my character upon death, they all seem to be working (and moving in the correct direction) other than the last one.

This is what happens to my character upon death, all projectiles seem to be working except the one supposed to move backwards, below is the code resposible for the spawning of projectiles.

function shoot(angleX, angleY, angleZ)
	local Character = script.Parent
	local speed = 5
	effectsFolder.Name = script.Parent.Name.." Effects"
	Debris:AddItem(effectsFolder,2)
	local InnerDanmaku = game.ReplicatedStorage:WaitForChild("Meshes"):WaitForChild("InnerDanmaku"):Clone()
	InnerDanmaku.CFrame = Character.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(angleX), math.rad(angleY), math.rad(angleZ))
	InnerDanmaku.Parent = effectsFolder
	InnerDanmaku.Size = InnerDanmaku.Size/2

	local Vel = Instance.new("BodyVelocity",InnerDanmaku)
	Vel.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	Vel.Velocity = InnerDanmaku.CFrame.LookVector * speed
end

--(death(character) is triggered on death)
function death(Character)
	for i,v in pairs(Character:GetDescendants()) do 
		if v:IsA("BasePart") or v:IsA("Decal") then 
			v.Transparency = 1 
		end
	end
	shoot( 90, 0, 0)
	shoot( -90, 0, 0)
	shoot( 0, 90, 0)
	shoot( 0, -90, 0)
	shoot( 0, 0, 90)
	shoot( 0, 0, -90) --faulty projectile
end


What would shoot(0,0,0) do? Can you try that?

Tested it with a single shoot(0,0,0) projectile, it goes straight foward

1 Like

Maybe try shoot(0,0,180) and shoot(0,0,-180)

If it doesn’t work maybe change each value to 180 then -180 each while keeping others 0?

1 Like

Oh thanks, turns out (180,0,0) is what i was looking for, ended up with

	shoot(0, 0, 0) -- foward
	shoot(90, 0, 0) --up
	shoot(180, 0, 0) -- back
	shoot(0, 90, 0) -- right
	shoot(0, -90, 0) -- left
	shoot(-90, 0, 0) -- down

1 Like