Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How To Detect If A NPC Is Touching A Brick?

Asked by 7 years ago

So I am developing a NPC with AI making so that it walks according to the placement of bricks but when it gets to a certain point. How would I make a "line" where the NPC could detect if there is another NPC infront of it or touching a brick infront of it so it forms an orderly line? Below is my current AI script:

order = game.Workspace.FoodTruck1.Order.Position


script.Parent.WalkToPoint = game.Workspace.Walk1.Position
wait()
script.Parent.WalkToPoint = game.Workspace.Walk2.Position
wait(5)
script.Parent.WalkToPoint = game.Workspace.Test1.Position
wait(5.5)
script.Parent.WalkToPoint = order
wait (80) --In case no one takes the order of the NPC, it will leave
script.Parent.WalkToPoint = game.Workspace.leave.Position
script.Parent.Parent.Head.Dialog:Destroy()
wait(5)
script.Parent.Parent:Destroy()

0
pathfindingservice?? idk what you mean abnotaddable 920 — 7y
0
...are you trying to reinvent pathfinding? Programical 653 — 7y

Answer this question