#bezier curve not working as i expect

74 messages · Page 1 of 1 (latest)

agile charm
#

basically zombie isnt walking through the dot and misses it

#

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

lime mauve
#

I see wakata

agile charm
#

like idk why it doesnt go throug hthe dot

lime mauve
#

its a bezier

#

it will not go thru the dot

agile charm
#

oh

lime mauve
#

if you want it to go thru

#

dont use a bezier

agile charm
#

then wat

#

wat do i use

lime mauve
#

just normal

agile charm
#

normal curve?

lime mauve
#

no curve

#

linear

agile charm
#

like instantly snap to other waypoint?

lime mauve
#

no

#

just tween it from point a to point b

agile charm
lime mauve
#

so iguess

#

just lerp

#

if you use MoveTo

#

it will change orientation on its own

#

Humanoid:MoveTo(Position)

#

but honestly

agile charm
#

no i dont use

#

humanoid

lime mauve
#

the bezier curve path doensnt look that bad

agile charm
#

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

lime mauve
#

ah

agile charm
#

which kinda looks ugly

lime mauve
#

then yeah just snap it ig

agile charm
#

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

lime mauve
#

i actually just took a look at it

#

it doesnt look that bad

#

its hardly noticeable

#

i'd say its good enough

agile charm
#

is there a way to like

lime mauve
#

based off that video alone ofc

agile charm
#

not make it happen

#

or no

lime mauve
#

yeah u can proabbly have another curve

agile charm
#

not a bezier curve?

lime mauve
#

ye

agile charm
#

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

lime mauve
#

Epic

agile charm
#
            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.....