I’ve read the documentation and have searched for posts and it doesn’t seem clear to me.
I heard about them from another post and they interested me about Vector3Curves (just remembered that it was a post about how Blade Ball’s system works)
Could anyone explain how they work (like how to use them)?
I know that there are FloatCurveKeys involved but other than that I don’t really understand it.
EDIT: I saw another post about Vector3Curves but once again it’s not really explained well
EDIT 2: So far no one has come forward and explained yet. Still gonna wait tho
Those doesn’t look to have an Icon or Name when generated, no properties that aren’t inherited from Instance, pretty much like nothing as far as you can see.
(its a vector3 with floatcurves)
They’re just data types typically used for the curve animation editor.
Ultimately they’re used to create splines composed of control points without having to manually do the math required for it.
local splinePoints = workspace:WaitForChild('SplinePts') -- our control points
local splineVisualization = workspace:WaitForChild('SplineVisualization')
local function updateCurve()
local points = {}
for _, child in splinePoints:GetChildren() do
table.insert(points, tonumber(child.Name) :: number, child.Position :: Vector3)
end
local curve = Instance.new('Vector3Curve') -- curve that will represent our spline
local floatCurves = { -- get our FloatCurveKeys, these will be used to give our curve positional data; each axis will have its own 1-dimensional curve
X = curve:X();
Y = curve:Y();
Z = curve:Z()
} :: { [string]: FloatCurveKey }
for key, point in points do
for _, axis in { 'X'; 'Y'; 'Z'; } do
local keypoint = FloatCurveKey.new(key / #points, point[axis], Enum.KeyInterpolationMode.Cubic) -- this will be a "keypoint" for which 1-dimensional curve we're working with
floatCurves[axis]:InsertKey(keypoint)
end
end
splineVisualization:ClearAllChildren()
-- now we can create parts for each increment along our Vector3Curve. here we do 0.01 as our increment for 100 "samples" along the curve
for i = 0, 1, 0.01 do
local part = Instance.new('Part')
part.Position = Vector3.new(unpack(curve:GetValueAtTime(i)))
part.Anchored = true
part.Size = Vector3.new(0.1, 0.1, 0.1)
part.Material = Enum.Material.Neon
part.Parent = splineVisualization
end
end
for _, child in splinePoints:GetChildren() do
child:GetPropertyChangedSignal('CFrame'):Connect(updateCurve)
end