3/2/2024 0 Comments Roblox studio humanoid moveto![]() ![]() Additionally, the Developer Hub didn’t seem to have any useful information. I’ve tried looking online and I found a few related issues, but none had an answer and many were quite old. The NPC stops moving, but the event isn't fired. Humanoid.MoveToFinished:Wait() -This code is getting stuck here. Path:ComputeAsync(position, targetPosition) -Create pathįor i, waypoint in pairs(waypoints) do -This loop makes the monster follow the waypoints to the player it is chasing. Local targetPosition = char:WaitForChild("HumanoidRootPart").Position or char:WaitForChild("Torso").Position ![]() Local player = PlayerService:GetPlayerFromCharacter(char) While not visible in the video, the NPC had already used PathfindingService with no issue to get to the player, but when used again, it started to bug out. At that time, it switches from raycasting and :MoveTo() to PathfindingService. = Vector3.new(Index, OriginalOrientation.Y, OriginalOrientation.In the video, the NPC functions–normalish–until the player moves around the corner. ![]() Local Target = game:GetService("Workspace"):WaitForChild() If Part.Parent:FindFirstChild("Humanoid") ~= nil and tostring() ~= "Enemies" then This is my code: local FollowZone = script.Parent However (as marked in a code-comment), with function :MoveTo(), the character doesn't return to the actual same position but an approximate. ![]() I want it to return to OriginalPosition and OriginalOrientation after the player dies. I have NPC which, presumably, is an Enemy. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |