How do I move a luanoid?

I’m working on a custom humanoid and I’m trying to get it to follow a path, but I’m not sure how to do it. Any help?

2 Likes

Use that module AIPathfinding found in the stock roblox zombie

1 Like

My model doesn’t have a humanoid in it.

Alter the ai pathfinding to not use the humanoid

What line is it?

ctrl f Humanoid dawg. It should give you a series of nodes to move to, move your lua noid to those points in whatever fashion

Read up here; https://developer.roblox.com/articles/Pathfinding

Instead of using the Humanoid:MoveTo, try to use your own method. One of things is to make it smooth when going in-between way-points so it doesn’t just teleport to each one. I’d use a BodyPosition or something.

2 Likes

If you are using an actual Luanoid as found found here then you will need to require core/Simulation. This has a method called :step(dt, input) where dt is delta time since the last time you called it and input is a table with number fields movementX and movementY. 0 means stop, positive/negative changes directions, and the direction is normalized (so any values will do and only the ratio between x and y changes direction). Simulation passes this these arguments down into the current state (walking, climbing, ragdoll) and calls the :step(dt, input) method on them. You can see what this does in the walking state in /core/CharacterState/Walking::step(dt, input)

Since this step method needs to be called to allow the character to even move, you probably have a script in the workspace which is already calling it. You can edit that script and set the movementX and movementY fields to the x and y distance to the points in character space (you can call HumanoidRootPart.CFrame:VectorToObjectSpace(distance) to get the character space distance. If it were me, I’d probably add a boolean isWorldspace and make the character state not convert the movement direction to worldspace if I already gave it a worldspace direction.

But this is all assuming that you are actually using that type of Luanoid.

1 Like

Using body position works, but my character keeps rotating or falling over whilst walking there, how do I solve this?