![]() ![]() 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. Insert a script into the rig and use a service called PathfindingService.In the video, the NPC functions–normalish–until the player moves around the corner. Ideally, you should insert a rig via the Rig Builder. Remember, in order for this to work, the robot needs to have a Humanoid object inside. Or, you could get the coordinates of the end location. ![]() To prevent any confusion, it is best to box the location in.įinally, at the end of the course, you should have one end pad. Now, we need to create a starting point at the start of the maze. These are all free models, so if you would like to use these, they are all available in the Toolbox. It contains a maze, lava jumps, a tightrope, and a Pick-a-Path puzzle. This is the obstacle course I will be using for this tutorial. Hello! This simple tutorial will teach you how to make a basic AI that can automatically find and follow paths.īefore we begin, you should have knowledge from the Advanced Scripting Tutorial.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |