NPC falling over and giving up on walking

Hello,

I am trying to make an adventure style game, which has an NPC that guides you through the game. The NPC is cloned out of replicated storage to the client so each player has their own NPC. I tried using pathfinding and whatnot to make the NPC move with you on the levels, but when the NPC goes to move, it kinda falls over then just stands there and gives up on moving. It is worth noting that I am using a custom script to play run/idle animations because the default animate script wasnt working for me, so I just play the run animation when the velocity of the NPCs HumanoidRootPart is greater than 0, and play the idle when it’s 0. How do I fix this issue?
image

2 Likes

This is an old problem, I posted about it years ago on here, and never really found an answer as to why it happens or how to stop it from happening.

I think its just some flaw with the humanoid. It happens when you move something with a humanoid into the world. When it starts to move or if even you touch it, it will ragdoll, at first.

I tried so many different things. However, what I think worked best but still never really solved the issue, was to move the npc into the world, then after a second, place in its humanoid.

2 Likes

Alright thanks, going to try it now.

2 Likes

I guess I was wrong what helped a bit was to move it by cframe after adding it to world. I guess now in our more modern time, you would use npc:PivotTo()

In my code, the NPC just stands there and then he starts walking after you complete an objective. Stands there perfectly fine until its time to walk, then he freaks out. I also am setting the NPCs CFrame to a specific location after cloning it already, and the issue persists.

1 Like

Yeah, like I said, its weird, I never solved it.
It seems ok, unless you touch it or it tries to move, the it freaks out.

Strange enough though, I once did a rig for a bear, R6, custom parts, and it never did have that issue happen. But then again, I did a horse, custom parts, R6, and it had the problem really bad.

Then I made a more modern horse, and it didn’t have the issue.
Then I moved the bear to a new project, and it developed the issue.

So, it makes no sense to me.

1 Like

Yeah seems super weird, I guess I can just spawn the NPC at locations instead of having it walk, really gonna take away from the game though, hopefully someone can respond and figure it out.

1 Like

Try to spawn it in, then have it walk. After it walks a second or two, then start it walking agian.

Maybe the first walk will glitch, then it will work better with the second walk

1 Like

Yeah actually right now I just removed pathfinding and am doing normal MoveTo, and it breaks only momentarily then walks just fine, so I am gonna see if it does it every time or just the one time.

2 Likes

Working now, just can’t use pathfinding and there’s like an 80% chance that it falls over the first time.

1 Like

Did you try to first make it walk just a little with MoveTo, then start the pathfinding after that?

1 Like

No actually, might give it a shot but I could just design the map to not require pathfinding, since the game focuses more on UI aspects than the map itself.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.