Sure, if I get A* working with AC I'll make it into a sort of compatibility asset and post it somewhere around here. You should totally make a category page for user-made modifications and resources for AC.
I really gotta get back into coding again, I've gotten so rusty and forgot such basic crap; could you point out where I went wrong in this? I have a feeling it must be something completely obvious, and maybe my sleep deprivation is the reason I'm not seeing it.
@Teirdalin : You wrote in a previous post: "Sure, if I get A* working with AC I'll make it into a sort of compatibility asset and post it somewhere around here."
So what about it, were your efforts crowned by success?
If you want to navigate a terrain, either bake a Unity NavMesh or export the terrain's mesh to a 3D tool, remove the vertices where you don't want characters to move, and re-import it as NavMesh to use with the MeshCollider method.
What if the scene level is made out of meshes already, all I have to do is set them in the layer NavMesh and the character should simply acknowledge and move to that point clicked? or do they have to be placed in the default NavMesh scene settings.
Yes - for MeshCollider pathfinding to work, the active NavMesh has to be known by the Scene settings, and must be a single mesh. You could either bake your NavMesh and use Unity Navigation, or merge your meshes into a single one using a 3D tool.
Hello, allow me to bump this old thread ! I'm trying to use A* with AC, to no avail so far. I decided to take things one step at a time and start with a simple cube NPC with no rigidbody orderded to move to a marker - A* is indeed called and the cube follows a path to to the marker, but cannot simply reach the point and stop there, and instead tends to move slightly around the target and rotate on the y axis in a jittery way.
I confirm that A* works as expected without AC and that the cube can otherwise stop at the marker, and I pretty much copy-pasted Salepaste's script - the WaitForPath function is now deprecated though and must be replaced with BlockUntilCalculated.
Has anyone successfully integrated A* in AC, or at least managed to simply send a basic NPC to a marker as I described ? Thanks in advance !
If you're still using AC to handle the character's motion once a path has been calculated, they still abide by AC's various movement settings.
If the character is spinning around the final node, it may be that you need to lower the "Destination accuray" slider in the Settings Manager, or enable "Retro-mode pathfinding" on the character's Inspector.
See the Manual's "Precision movement" chapter for more on this topic.
Comments
Chris has given some more advice on this topic in the old forum thread here:http://forum.unity3d.com/threads/204414-Adventure-Creator-Make-3D-adventure-games-(DEMO-VIDEO-WEBSITE
Unfortunately I wasn't able to find the post anymore, but maybe you can find it yourself using "NavigationManager" or Pathfinding as search terms.
Good luck!
orrence.
- Create a script called NavigationEngine_AStar, and make it a subclass of NavigationEngine.
- Edit Enums.cs and add AStar into the AC_NavigationMethod enum definition.
- Inside your new script, you will need the following override function:
public override Vector3[] GetPointsArray (Vector3 startPosition, Vector3 targetPosition)You can add other code to your script, but this is what's used by AC to return a calculated path.
With the script complete, you should be able to choose it in the Scene Manager's selection of pathfinding methods.
So what about it, were your efforts crowned by success?
Cheers!
Also as prerequisites :
Hello, allow me to bump this old thread ! I'm trying to use A* with AC, to no avail so far. I decided to take things one step at a time and start with a simple cube NPC with no rigidbody orderded to move to a marker - A* is indeed called and the cube follows a path to to the marker, but cannot simply reach the point and stop there, and instead tends to move slightly around the target and rotate on the y axis in a jittery way.
I confirm that A* works as expected without AC and that the cube can otherwise stop at the marker, and I pretty much copy-pasted Salepaste's script - the WaitForPath function is now deprecated though and must be replaced with BlockUntilCalculated.
Has anyone successfully integrated A* in AC, or at least managed to simply send a basic NPC to a marker as I described ? Thanks in advance !
If you're still using AC to handle the character's motion once a path has been calculated, they still abide by AC's various movement settings.
If the character is spinning around the final node, it may be that you need to lower the "Destination accuray" slider in the Settings Manager, or enable "Retro-mode pathfinding" on the character's Inspector.
See the Manual's "Precision movement" chapter for more on this topic.