Help with Ai and npc

hi, I am starting to use pathfinding and raycasting.
I am wondering how and what system I should use for a turret system with targets other moving Ai and another Ai which targets turrets or other blocks such as walls.
how do I make it so pathfinding targets the closet with a specific name like “turret” or do I put turret in a folder where it can run each turret. if I use this how do I determine the closet?
and how do I make for the opposite ai which targets the others, would it be the same?

some things that I have tried are making a sensor that reads the name of the part humanoid touched then targets the ai, but I don’t think this works with other ai.

1 Like

Hey, you can read all about path finding Here, and plus Npc moving.

1. Path finding : {Character Pathfinding | Roblox Creator Documentation}
2. Npc Movent : {Character Pathfinding | Roblox Creator Documentation}

1 Like

how would i make multiple targets that change due to the closest?

You should watch this series Player Killing Monster AI - Teddy Horror Gamedev #3 - YouTube

2 Likes