Hello! I am having troubles with my AI code. I wanna make a Granny-like AI script, and I’ve used a few scripts as references (Teddy AI, Piggy AI etc.) to write my own.
THE ISSUE:
The NPC stars slamming into the wall for some reason, even though I’ve added AgentHeight and AgentRadius.
I’m using the PathfindingModifiers BETA feature since that was my only hope and it still didn’t work.
Thank you for your time and if you have any solutions, please tell me because I’ve been trying to solve this issue for a while.
Here is the part of the script that creates a path for the NPC.
local function getPath(destination)
local path = PathfindingService:CreatePath({
AgentHeight = 4,
AgentRadius = 3,
AgentCanJump = true,
Costs = {
AvoidZone = math.huge
}
})
path:ComputeAsync(Grandad.HumanoidRootPart.Position, destination.Position)
return path
end```