Hello.
I have an AI(the small ghost on the picture) and a target for it(the big ghost on the picture). When I destroy a ball on the board I update(scan) available points.
Is it possible to make small ghost always move to the closet available point when I shoot(Scan the points).
I use a AILerp script to move the small ghost.
Thanks in advance!!!
Moving to the closest point the AI can reach should be the default behavior. It will try to find points up to a distance of A* Inspector -> Settings -> Max Nearest Node Distance. If the distance to the closest point it could reach is greater than that value then the path will fail instead.
the small ghost to the big three ghosts.
It will move only if the path will be without any obstacles to the end. I mean if there will no be any obstacles.
Do you think you could send me a simple test scene which shows the problem, and then I could try to debug it.
Please specify your Unity version as well.
Ok…
Open the “TestPointGraph” scene
Start the scene…
Hierarchy -> Body -> Grid -> TESTBALL
Activate this object and press the “Scan” in A*.
And only after that the small ghost wil go.
Maybe I’m wrong, but I thought that it should go to the nearest point to the target, for example black circle on the image.
Thanks for sharing that!
It looks like you have stumbled upon a bug. Specifically this bug only happened in the free version when using a point graph. To fix it, open the PointGenerator.cs script and replace the two methods GetNearest and GetNearestForce with this: