The AstarAI script works, what is odd is that the AIPath script doesn’t work, the capsule just stands there, no green line to target, however if i drag around the target transform enough in play mode then they work correctly.Or if i drag around the AI in the scene view in play mode they also come alive and start to work.
(note for more information they may move an inch but then stop, once dragged the AI or the target around scene then they work correctly).
follow up on this:
i am trying to use aipath.target and give it a Vector3 (mouse location clicked)
I am pretty sure that this was working in a previous version of A*, has the function changed to only accept a transform now? I see in your examples you use a transform but i am sure i was previously able to provide a vector3
But documentation states:
Target to move towards.
The AI will try to follow/move towards this target. It can be a point on the ground where the player has clicked in an RTS for example, or it can be the player object in a zombie game.
In my previous project where i used a vector3 i loaded it up in unity 5 but had to upgrade A* project files as per here:
and now it doesn’t compile saying that transform needed for aipath.target
going mad or did it once accept vector3?
My guess is that your character has a layer which is included in the “Height Testing” mask on the grid graph. This have resulted in that a single node has been created on top of the character’s head. When it tires to find a path to some other position it will not find any path that can move it away from that node.
Try to remove the character’s layer from the Height Testing mask.
I’m pretty sure it has never been possible to provide a Vector3 directly. You must have done those modifications yourself at some point.
that was it, i didn’t setup the height testing correctly!
Thanks for taking the time to reply to me for what was a very basic question, and thanks for confirming the vector3 question that was bugging me.
I am thinking quite strongly of purchasing your full package, but with current cash flow its quite a big investment for me.
could i ask your advice, what i want is a flat plane, where player at runtime can place walls and stairs, and archways.
I need an pathfinding system that will allow AI to not walk into the walls (simple) but allow them to walk up the stairs which could be connected to a wall so they could walk on top of the wall, and importantly allow the AI to walk under archways.
I was reading up on your documentation and i think that Recast graph may be able to achieve this ?
Also last question, do you have any thought on Unitys new beta 5.6 navmesh
Low-Level API for NavMesh building:
Create and update NavMesh data at runtime.
Use multiple instances of NavMeshes.
Control the life-time of the NavMesh instances.
Create and manage NavMesh Build Settings for multiple agent sizes.
I am going to look into it, but do you think unitys new system would be powerful enough to achieve my needs?
A recast graph could do what you want. Depending on the resolution and size of the graph updates when you place a stair, you may have some issues with performance, but it is hard to say. If the world is not too large, a layered grid graph might be preferable due to the much faster graph updates.
Since Unity also uses a system very similar to the Recast graph (in fact, it is based on the same system originally) they will do very similar things. It sounds like Unity’s system could handle it, but I don’t know what the performance would be.