What values should I use

Sorry if my writing makes no sense, I’m really stressed out.
How could I possibly create a simple bezier curve for the X, Z, & Y values?

local StormHeight = math.random(1000, 1500)
local StormQuality = 2000
local SQ = math.round(StormQuality / 3)
local TP = Vector3.new(math.random(-500, 500), StormHeight, math.random(-500, 500))
local MP = Vector3.new(math.random(-150, 150), (StormHeight * 3) + math.random(-200, 10), math.random(-150, 150))
local BP = Vector3.new(math.random(-50, 50), 0, math.random(-50, 50))
for i= 1, SQ do
	local X = (TP.X - ((BP.X / (SQ))) * (i / (1 - i / SQ)))
	local Z = (TP.Z - ((BP.Z / (SQ))) * (i / (1 - i / SQ)))
	local Y = BP.Y + (i * (TP.Y / SQ))
	local Vector = Vector3.new(X, Y, Z)
	local Part = workspace.Part:Clone()
	Part.Parent = workspace
	Part.Position = Vector
end
1 Like
local StormHeight = math.random(1000, 1500)
local StormQuality = 2000
local SQ = math.round(StormQuality / 3)

local P0 = Vector3.new(math.random(-500, 500), 0, math.random(-500, 500))
local P1 = Vector3.new(math.random(-150, 150), (StormHeight * 3) + math.random(-200, 10), math.random(-150, 150))
local P2 = Vector3.new(math.random(-50, 50), StormHeight, math.random(-50, 50))

for Index = 0, SQ do
	local T = Index / SQ
	local OneMinusT = 1 - T

	local X = (OneMinusT^2 * P0.X) + (2 * OneMinusT * T * P1.X) + (T^2 * P2.X)
	local Y = (OneMinusT^2 * P0.Y) + (2 * OneMinusT * T * P1.Y) + (T^2 * P2.Y)
	local Z = (OneMinusT^2 * P0.Z) + (2 * OneMinusT * T * P1.Z) + (T^2 * P2.Z)

	local Vector = Vector3.new(X, Y, Z)

	local Part = workspace.Part:Clone()
	Part.Parent = workspace
	Part.Position = Vector
end

Is that what you are asking for? I cleaned up the code

1 Like

Can you please uh… rename all the variables back? I named them like that for a reason.

Just put the names back
TP = P0
MP = P1
BP = P2

1 Like

…this isn’t what I’m looking for. I’m trying to make a smooth curve (I haven’t learned what a bezier curve it, I’m homeschooled), not a straw. :confused: