#bezier curve not working as i expect
74 messages · Page 1 of 1 (latest)
i made the magnitude rlly high to show it better
change = numvalue:GetPropertyChangedSignal("Value"):Connect(function()
local bezier = Quad(numvalue.Value + 0.01, point_a, point_b, point_c)
local pos = Quad(numvalue.Value, point_a, point_b, point_c)
AP.Position = Quad(numvalue.Value, point_a, point_b, point_c)
AO.CFrame = CFrame.lookAt(pos, bezier)
oldnum = numvalue.Value
if zombie.PrimaryPart == nil then
change:Disconnect()
end
end)
turning
local function Lerp(a, b, c)
return a + (b - a) * c
end
local function Quad(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
the bezier curve itself
I see wakata
oh
just normal
normal curve?
like instantly snap to other waypoint?
(i mean the orientation)
so iguess
just lerp
if you use MoveTo
it will change orientation on its own
Humanoid:MoveTo(Position)
but honestly
the bezier curve path doensnt look that bad
no no
the thing is like
after the turn isw done
it moves to the waypoints position
and since
its not alligned that well
it just slides
to the waypoint
ah
which kinda looks ugly
then yeah just snap it ig
is there a way
to do curve
that goes through the dot
this is like what i wanna do
the black dot here is the waypoint
i actually just took a look at it
it doesnt look that bad
its hardly noticeable
i'd say its good enough
is there a way to like
based off that video alone ofc
yeah u can proabbly have another curve
not a bezier curve?
ye
i searched bezier curves
and i found this
basically visualized curve
i wonder why mine isnt perfectly alligned though
oh hey
i found the problem
i think
i just have to fix it
ok i fixed it
Epic
local point_a = zombie.PrimaryPart.Detect.WorldPosition
local point_b = currentway.WorldPosition + (zombie.PrimaryPart.CFrame.RightVector * random)
local magn = (point_a - point_b).Magnitude
local i
if not waypointss[waypoint + 1] then
i = currentway
else
i = waypointss[waypoint + 1].Attachment
end
local zombietime = magn/zombie:GetAttribute("Speed")
local point_c = currentway.WorldPosition + (zombie.PrimaryPart.CFrame.RightVector * random) + (i.WorldCFrame.LookVector * (8 + random))
rahhh ididnt SOLVE IT.....