Hello, I have been wondering how to make an AI for my Survival game. I’ve checked YouTube but what I can find is no video related to what I’m looking for. I have no idea how to make it.
I’ve already checked the link below but it strangely doesn’t work because of the word in the Lua Code “pathParams”.
To answer your question, do not just put in “pathParams” just leave it blank.
In order to use the path that you just defined in a variable you need to tell the game where this NPC has to go by using :ComputeAsync() example: path:ComputeAsync(NPC_HumanoidRootPart.Position, Destination.Position/PrimaryPart) so basically you need to compute it in order to make it work.
Models use PrimaryPart instead of Position so do not forget to set the PrimaryPart before doing that.
Then once you have done that you can simply just say:
NPC_Humanoid:MoveTo(Destination.Position/PrimaryPart) and it will work, but this is just basic stuff, if you want to make your NPC smarter you will need to use the path waypoints and make a for loop to make the NPC move to them which can be found on the Pathfinding article here: Character Pathfinding | Documentation - Roblox Creator Hub
Pathfinding is somewhat complex, if you’re new to lua I’d reccomend starting off easy and moving off to pathfinding when you learn things like raycasting, and magnitude.