The old code functions better, but it freezes at the Humanoid.MoveToFinished:Wait() line, making it unusable as well. Instead of the NPC switching smoothly between AI navigations and simple Humanoid:MoveTo(player), the NPC no longer uses AI navigation, although it is running the code, and it is much buggier than before. I’m not sure if I’ve implemented this wrong, but this seems to break the entire navigation system. Humanoid.MoveToFinished:Wait() Doesn't Fire Properly Scripting Support Local RandomPosition = math.random(1,#RandomPart) Local RandomPart = workspace.Path:GetChildren() Task.wait(3) -// wait for 3 sec Just For Test If humanoid.WalkToPoint ~= targetPoint then If not (humanoid and humanoid.Parent) then Local function moveTo(humanoid, targetPoint)Ĭonnection = humanoid.MoveToFinished:Connect(function(reached) I am running the script for about 10 Minutes now and it’s working fine for me local Move = true Thanks for reading this and any help is appriciated! Ignore the bland looking game, im focusing on the Scripting first. Path:ComputeAsync(, RandomPosition.Position)įor i,v in ipairs(Path:GetWaypoints()) do Local Path = game:GetService("PathfindingService"):CreatePath() Server Script located inside the NPC: :SetNetworkOwner(nil) They even go back to being smooth aswell. I have tried looking something up but found nothing.Įverything works fine, one NPC in the video even walks smoothly, but after a while starts stuttering like the others. My issue is that after about 5 repeats, they start stuttering seemingly for no reason. Im making a Sequel to one of my older games called Retail Store (goofy puzzle, destroy store and annoy npcs game), and ran into a issue with my new NPCs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |