#npc moving in a straight line

1 messages · Page 1 of 1 (latest)

chilly echo
#

i've been trying to have it so my npc moves in a straight line, i'm using a pathfind system, one of them does, while the other does a little drunken like dance.
i attached a video for example of what i mean, and the slimes rig.

fallow scaffold
#

Can you paste the script responsible for pathfinding

chilly echo
#

local function NPCMove(NPC)
for i = 1,#workspace.CheckPoints:GetChildren(),1 do
local CheckPointNumber = 1

    NPC.Humanoid:MoveTo(workspace.CheckPoints["CheckPoint"..CheckPointNumber].Position)
    
    local AT = NPC.Humanoid
    
    NPC.Humanoid.MoveToFinished:Connect(function()
        CheckPointNumber += 1
        
        if CheckPointNumber == #workspace.CheckPoints:GetChildren() then
            NPC:Destroy()
        else
            NPC.Humanoid:MoveTo(workspace.CheckPoints["CheckPoint"..CheckPointNumber].Position)
        end
        
    end)
end

end

#

this is the code

fallow scaffold
#

looks fine

#

def a problem with the models ur right

#

the checkpoints r just invisible parts right

chilly echo
#

right

fallow scaffold
#

is everything welded to humanoid root part?

chilly echo
#

can you dumb it down a bit

#

how do you weld stuff to stuff?

fallow scaffold
#

did you make the model

chilly echo
#

yes

urban foxBOT
#

studio** You are now Level 1! **studio

fallow scaffold
#

add weld constraints to the humanoid root part

#

each weld has 2 attachments

#

for each of the parts that isnt the root part, set one of the attachments to that part, and the other to the hrp

#

see if that allows it to move normally

#

either that or import a humanoid rig, make everything invisible, weld the slime the invisible rig, and animate that

#

if that doesnt work ping me

chilly echo
#

@fallow scaffold it worked but now they are floating and looking backwards

fallow scaffold
#

if they are floating ur hipheight value is too high

#

i think you can edit it in humanoid properties

#

but im not opening studio to check

#

and the looking backwards thing can be fixed by clicking on the humanoid root part and changing its rotation 180 degrees ig

#

sounds scary ngl

chilly echo
#

fixed the floating, and i couldn't find the looking backwards in humanoid properites then i realized wait i made the model, i can just move the eyes to the other side and that fixed that problem

fallow scaffold
#

That works too ig