Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to make a JJBA Barrage Effect using Bezier Curves?

So basically i am trying to make a function where i fire a remote then a Arm appears then curves around the player

local TS = game:GetService("TweenService")
		local rarm = game.ServerStorage.arm:Clone()
		rarm.Parent = workspace.BarrageEffects
		local root = player.Character.HumanoidRootPart
		rarm.CFrame = root.CFrame + -root.CFrame.LookVector*2 + root.CFrame.UpVector*2 + -root.CFrame.RightVector*4
		rarm.Orientation = Vector3.new(22.52, -135.9, -69.64)
		rarm:ClearAllChildren()
		rarm.Anchored = true
		function lerp(a, b, c)
			return a + (b - a) * c
		end
		function quadBezier(t, p0, p1, p2)
			local l1 = lerp(p0, p1, t)
			local l2 = lerp(p1, p2, t)
			local quad = lerp(l1, l2, t)
			return quad
		end

		local p0 = root.Position + -root.CFrame.LookVector*2 + root.CFrame.UpVector*2 + root.CFrame.RightVector*4
		local p1 = root.Position + root.CFrame.LookVector*4 + root.CFrame.RightVector*7
		local p2 = root.Position + root.CFrame.LookVector*10 + -root.CFrame.UpVector*2 + root.CFrame.RightVector*.3

		spawn(function()
			for t = 0,1,.08 do
				local curve = quadBezier(t,p0,p1,p2)
				rarm.CFrame = CFrame.new(curve)
				game:GetService("RunService").Heartbeat:Wait()
			end;
		end)
		game.Debris:AddItem(rarm,1)

this is what i have and it works but idk how to make it rotate as well please help me

1 answer

At line 26, rewrite the sentence to rarm.CFrame = CFrame.new(curve) * CFrame.Angles(math.rad(90),0,0) and that'll do it

This discussion is preserved as it was. New answers, comments, and votes are closed.