So a lot of people tell me to use raycast and i’ve tried to search around but i have no clue to how to do it, Any better ideas, If not how will i use raycast?
Here’s my current script
local Human = script.Parent:WaitForChild("Monster")
local Torso = script.Parent:WaitForChild("HumanoidRootPart")
local PathArgs = {
["AgentHeight"] = 10,
["AgentRadius"] = 18.5,
["AgentCanJump"] = true
}
function Move()
local goal = workspace:WaitForChild("briankiller8").HumanoidRootPart.Position
local Path = game:GetService("PathfindingService"):CreatePath(PathArgs)
Path:ComputeAsync(Torso.Position, goal)
local Waypoints = Path:GetWaypoints()
for _, waypoint in pairs(Waypoints) do
local part = Instance.new("Part")
part.Shape = "Ball"
part.Material = "Neon"
part.Size = Vector3.new(0.6, 0.6, 0.6)
part.Position = waypoint.Position
part.Anchored = true
part.CanCollide = false
part.Parent = game.Workspace
end
for _, Waypoint in pairs(Waypoints) do
if Waypoint.Action == Enum.PathWaypointAction.Jump then
Human.Jump = true
end
Human:MoveTo(Waypoint.Position)
Human.MoveToFinished:wait()
end
end
while true do
wait()
Move()
end
I guess you could. Sometimes in situations like this it helps to add in invisible blocks to help correct the mesh. If you put them in a collision group that default can’t collide with then it won’t change the way the players move around on the terrain at all.
We have actually had a similar issue with our pathfinding, where the AI would attempt to navigate an elevated portion of the path such as that. We ended up settling for a more simple approach, because we didn’t really need the pathfinding after all.