Search Unity

Poly|Nav: Pathfinding for Unity2D

Discussion in 'Assets and Asset Store' started by nuverian, Jan 27, 2014.

  1. iso250

    iso250

    Joined:
    Apr 19, 2015
    Posts:
    28
    I've figured out how to do this.

    I added a float called TurningSpeed in to the PolyNavAgent script.

    In the script, search for "//seeking a target". Change the code immediately below that to this.

    Code (CSharp):
    1. //seeking a target
    2.     Vector2 Seek(Vector2 pos){
    3.  
    4.         Vector2 desiredVelocity= (pos - position).normalized * maxSpeed;
    5.         Vector2 steer= desiredVelocity - velocity;
    6.         steer = Truncate(steer, maxForce) * TurningSpeed;
    7.         return steer;
    8.     }
    The next section is called "//slowing at target's arrival". Change that to this.

    Code (CSharp):
    1. //slowing at target's arrival
    2.     Vector2 Arrive(Vector2 pos){
    3.  
    4.         var desiredVelocity = (pos - position);
    5.         float dist= desiredVelocity.magnitude;
    6.  
    7.         if (dist > 0){
    8.             var reqSpeed = dist / (decelerationRate * 0.3f);
    9.             reqSpeed = Mathf.Min(reqSpeed, maxSpeed);
    10.             desiredVelocity *= reqSpeed / dist ;
    11.         }
    12.  
    13.         Vector2 steer= desiredVelocity - velocity;
    14.         steer = Truncate(steer, maxForce) * Mathf.Max (TurningSpeed, 2.5f);
    15.         return steer;
    16.     }
    Now you can adjust TurningSpeed and it will affect the turning rate.
     
    johanneskopf likes this.
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    The pushing is certainly happening due to having added rigifbodies, yes. You don't need rigidbodies attached for polynav to work though, so you could try removing them, or set them to kinematic, if you still want to have rigidbodies for othe reasons for example. Without rigidbody, there is no pushing :)

    Let me know.

    Hi,
    One way to do this would be to add some velocity based on the agent's up vector. Here is a hack to do this. Add this line after line #252 in PolyNavAgent.cs. The agents will have a hard time reaching the goal though if there is a lot of turnings though:
    Code (CSharp):
    1. velocity += Vector2.Lerp(Vector2.zero, (Vector2)transform.up * lookAheadDistance, remainingDistance/slowingDistance);

    Thanks for sharing :)
     
    johanneskopf likes this.
  3. Wylht

    Wylht

    Joined:
    Nov 19, 2015
    Posts:
    1
    Guys, that tips to try to reach exactly point was very helpful, really thx. I'm ok with that, but I also recommend the creation of a method agent.SetExactDestination. :) I'm using a lot the method setDestination just to make my "gameObject" to move to a specific location, if the location was more precise, would be better. :)
    Thx again.
     
  4. LunaTrap

    LunaTrap

    Joined:
    Apr 10, 2015
    Posts:
    120
    Hi, im interested in PolyNav, but i have one question, is there a way to get the position of the next "node" or next vertex of the path?

    on an unrelated note, can someone tell me how i reference an user when i make a comment? sorry for the dumb question :p
     
  5. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,

    Yes you can get the position where the agent is heading towards next, through the "nextPoint" property :)
    You can reference other users like this: "@Username".

    Cheers
     
  6. fayte0618

    fayte0618

    Joined:
    Dec 4, 2013
    Posts:
    9
    Hi! I would like to ask if you have any suggestions on dynamic polygon collider 2d for PolyNav. Like we setup the floor and then if we click the editor script those floor tiles will combine to become one polygon collider 2D. Because, currently in our game we made walls into obstacles and when run it's very heavy on mobile, so the alternative was to make a dynamic polygon collider 2d for polynav but it's very hard to do.

    Thanks! for the help
     
  7. barshai

    barshai

    Joined:
    Mar 17, 2016
    Posts:
    1
    Hey!
    This assets looks awesome.
    Before I purchase this assets, I need to know if it supports backgrounds and paths built on several z position, to make a parallax effect.
    Is this assets depend on other assets?

    Thanks!
     
  8. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    There is no automatic way of combining polygons together included if that is what you ask. There is a library called clipper that might help you in doing this, but haven't tried it myself to provide a clear answer how it's done. Maybe someone else here has though.
    Thanks.

    Hello and thanks.
    There is not built-in way for parallax effect if that is what you are asking. PolyNav works in a single xy plane, while z is left unaffected, so you can alter it if you like. Regarding other asset dependency I am not sure what you mean :) It is a standalone asset.
    Let me know if you have any oher questions or need some clarifications.
    Thanks.
     
  9. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    In the description it states that this is useful for platform games but I don't see any in the example videos.
    How does this handle gravity, jumps, double jumps and other special moves that afford the characters' movement options? eg. wall jumping or a flying uppercut..

    I've seen one guy use this for a platform game (he was the one that recommended it to me actually).


    I was wondering if it required much work to get up and running or if I can pop an agent into an existing 2D platform scene full of box colliders (or a procedurally-generated scene) and he would know how to navigate?

    And is the agent able to handle one way platforms that can be jumped/dropped through (common to most platformers).
     
    Last edited: Mar 20, 2016
  10. Matt-Face

    Matt-Face

    Joined:
    Mar 24, 2013
    Posts:
    22
    Hi, How can i calculate the entire distance of a path, and also I need to find the closest walkable destination that is nearest to a given point. Thanks!
     
  11. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    PolyNav don't handle jumps, or gravity in any way. Sorry for the confusion of the platform term in the description, but I was refering to platform games where there is no jumping/gravity involved like double dragon or castle crushers. It will require a lot of changes to make PolyNav work with gravity and jumping like in the video. Maybe @Sluggy can shed some light on how he did that if he so wish.

    Thank you.

    Hello,
    There is already a property in the PolyNavAgent class called "remainingDistance" that does exactly that :)
    To find the closest walkable position to a point, you can use
    PolyNav2D.current.GetCloserEdgePoint(Vector2 pos);
    Also remember that this can be done automaticaly if you set "Closer Point On Invalid" to true, in the PolyNavAgent component inspector in case that is what you are after.

    Thanks.
     
  12. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Those are known as side-scrolling beat-em-up games.
    They are different from platformers (it's easy to remember as they contain no platforms - just the ground which is a flat surface).

    I've checked all of the older replies now and it looks like there's been a lot of requests for platforming and you have advised that this is not for platforming, so maybe take that out of the description..
     
    Last edited: Mar 26, 2016
  13. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    983
    To clarify a little more, I used Polynav2D solely for the pathfinding. The agent was one of my own design. Really, any pathfinder can be used for this task but I chose Polynav2D due to its ease of use and its lightweight node generation (grids are more useful for platformers but also more memory intensive). I won't lie, the agent took some work and I had a couple of false starts. The easiest way to make it work better was to use a nav hint system (also my own) to provide cues to the agent in some of the more tricky parts to navigate.
     
    nuverian likes this.
  14. evilsephiroth

    evilsephiroth

    Joined:
    Jun 13, 2013
    Posts:
    3
    Hi and thanks for this nice asset. I have a couple questions about the usage.

    1)Is it possible to get the closer point to a destination blocked by obstacles ?
    Example: A path is blocked(temporarily) from an obstacle but the object I click is on the other side of the screen...
    Ideally, the player would try to get closer to the objects so at the limit of the obstacle...
    Closer point on invalid works only for reachable point.
    An example use case : A path is blocked by a car.There's an object beneath the car visible. I want to examine that. But to examine I would like the player to go near the car to look at it...
    Right now, I'm defining interaction point for every object and I want to avoid that... I know the correct way to do is to negate movement but for gameplay, the player should go at the closest position to the object even if he cannot interact temporarily with it...

    2)Is it possible to recreate the poly nav + obstacles entirely from script?
    I have an in-game editor for designers that use a dummy scene and they can add components and game objects. A custom save button, saves level data as a scriptable object. Then, in-game, we use scriptable objects to do initialization and population with objects on the dummy scene.
    Correct me if I'm wrong: I should save obstacle data(for all obstacles) and polynavAgent parameters for acceleration and that's it...

    Thanks in advance.
     
  15. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Unfortunately the answer to your first questions is that it's currently impossible. This is something I've been looking at implementing and will take another look at soon, but haven't yet figured out a good and efficient way to go about it.

    Regarding your 2nd question, since PolyNavObstacle is a component usualy attached on the obstacle sprites of your scene, the navigation map should regenerate automaticaly whenever such an object is enabled/instantiated in the scene as long as you have "Regenerate On Change" set to true in the PolyNav inspector. So, there is no need to save anything for obstacles as long as they are on objects that get instantiated from prefabs for example. Can you please clarify a bit, because maybe I misunderstood something :)

    Thanks.
     
  16. evilsephiroth

    evilsephiroth

    Joined:
    Jun 13, 2013
    Posts:
    3
    Hi nuverian,
    1)I'm actually working also modifying slightly your script. Basically, if there'svno path found due to destination not reachable, I'm linecasting from target to player. Destination becomes the first poin on polygon that collides with the ray. I'm still testing though. If you want,I can send you a pull request also.

    2) basically I have only a scene for all my rooms. Initialization of this dummy scene is done by a script reading from a scriptable object containing scenes information(game objects/prefabs with component attached,etc...). I use editor scripts to ease work of designers. Typically, they create the scene and save on my scene database... It's a data centric approach but we use it for tuning and testing... We have custom tools to view,search and modify scene data and easing data entry. A lot of content to only save in scene :)

    So, in order to save polynav information, I should save polynav parameters, polygon colliders information for both obstacle and walkable area to my scene database. My question was only if I was missing another important piece of data in order to recreate at runtime the scene with polynav objects...I've not tested at the moment.

    Thanks again.

    Francesco
     
  17. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Hello @nuverian,

    I want to create 2D Pixel Top Down Game and I have some question about when a character above and below bridge. What is the best way to achieve this result ? How to define the walkable above bridge and below bridge area.

    See pic below.

    Thanks
    PS, pic from Faraway Game (Not my game), just to help me explain the question

     
  18. smasters654

    smasters654

    Joined:
    Dec 20, 2013
    Posts:
    46
    @nuverian I sent you two emails. Please let me know if you got them. I am not sure if they went to a spam or junk folder because it did have an error log in it. Thanks!
     
  19. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Thanks for the details. There shouldn't be anything else that needs to be saved for it to work. It seems you have everything covered ;)
    Thanks

    Hello and sorry for the late reply.
    Unfortunately this kind of layered-pathfinding is not currently possible to be achieved somehow. I will take a look at if it's possible to be implemented in any way in the future.
    Thanks for your interest in PolyNav though :)

    Hey, Sorry for the late reply. I've just send you an email.
    Thank you.
     
  20. nproject

    nproject

    Joined:
    Jan 16, 2015
    Posts:
    68
    Oke let me know if you gonna implement that.
    Can I do something like create 2 navpoly and collider2D in bridge
    then when player go up in a bridge navpoly Ground is not active and navpoly Level 1 is active
    but when player go down, navpoly Ground is active and navpoly Level 1 is not active ?
    Thanks
     
  21. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    heey hello!
    Can / would you explain this a bit more? I am interested in getting the jump working in polynav2d.

    Best regards! T
     
  22. jcurrie331

    jcurrie331

    Joined:
    Apr 16, 2013
    Posts:
    2
    Hello, I seem to be encountering an issue with negative scaling, in that Poly|Nav does not work properly if any obstacles are scaled in the negative direction, in order to flip them horizontally, for example. Attempting to send an actor to the other side of an obstacle that has been mirrored horizontally (ie scale.x = -scale.x) results in the path being canceled.

    This happens regardless of whether the PolyNav2D class is set to "Regenerate On Change", and manually regenerateFlag = true or GenerateMap (true) on the PolyNav2D instance does not help either. Is there any way around this, or is this a bug in the system?

    Thanks for your help!

    - John
     
  23. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    When it get's implemented it will work something very similar to how you describe, yes.
    I will make a post when that is ready.
    Thanks!

    Hello,
    There is an option on the PolyNavObstacle inspector to "Invert Polygon". Please set this to true and let me know if it works for you for when you have the obstacle inverted. I will take a look at handling this automatically if possible for the next version as well.
    Thanks.
     
  24. Lagnas

    Lagnas

    Joined:
    Apr 27, 2014
    Posts:
    18
    I want to agent objects avoid each other.

    Ofcourse, I set up agent`s avoid radius 0.25f and more.
    All agent object contain box collider 2d.

    But, agent objects are overlaped while move to destination.
    They avoid obstacle collider successfully, but they don`t avoid each other agent object.
     
    Last edited: Apr 14, 2016
  25. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    983
    Sure thing, I'll try to keep it brief.
    1. First thing was to find out if the player clicked inside an obstacle. If so, find the closest point outside that obstacle (and its skin) and use that location. At the time I had to modify Polynav a bit to do this but I think it's a simple option in the inspector now.
    2. Next, I would raycast downward (about 100 units for my case) to find ground (again, adjusting for the obstacle's skin). This would be used as the final location to path towards.
    3. Have polynav generate a path for the current player position to the adjusted final position.
    4. At this point the agent could begin moving. It used a rigidbody2D and a 2D capsule collider. The controller was modified from one I used previously for a platformer. It could move left and right while following the contour of the ground as well as jump.
    5. As the agent reaches a node it checks for the next node in the path. At the most basic level it is simply trying to move left or right to reach the next node. Nothing special really.
    6. A couple of raycasts are fired in the direction of travel and are used to determine if there is anything that could impede movement to the next node like a ledge. If the slant of the obstacle is gradual enough or the height of a wall is low enough (think stairs) then it does nothing because the controller will simply walk right over it. If there is a wall detected then more raycasts are used to see if it can be jumped. If so the controller is instructed to jump at the right time (adjusted for speed, height, distance to the wall, etc).
    7. If all else fails and the agent finds that after a period of time it can't make progress (measured as the total distance of all remaining nodes in the path) then it will try to re-path from its current location. If it still can't make progress it simply gives up. You'll notice in the video this was causing some issues as it is very hard to calibrate it to not give up too soon or too late,
    For more complicated places like pits or overlapping ledges where the agent has to backup or move in different directions I originally tried to use more raycasts to determine what actions to take but eventually just settled on using navigation hints. They are objects placed in the scene that when the agent comes in contact with will instruct it exactly what to do and when. They usually have instructions like 'jump now' or 'redirect to this location, then continue towards the original destination'.

    Hope that helps.
     
    stationx and nuverian like this.
  26. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Do you mean that they completely ignore the avoidance? Also please remember that all agents that need to avoid each other need to have an avoidance radius, not only one of them.
    Are your results nowhere near this?:


    Thanks.
     
  27. stationx

    stationx

    Joined:
    Jul 9, 2012
    Posts:
    251
    Thnx! Yes, this very helpful!
    Appreciate!!
     
  28. Dyspen

    Dyspen

    Joined:
    Mar 28, 2016
    Posts:
    7
    Hi there.

    I am a Unity and game development newbie. For setting up my maps I used Tiled which can create collision tiles and via Tiled2Unity a polygon collider is produced in Unity when importing the map.
    However when I copy the collider from the imported gameobject file and paste it's values, it doesn't seem like the script is following along. I am VERY new to everything, so maybe I am just not seeing the whole picture, however I don't know where else to go for help.
    See the following two images for reference. One is just polygon collider, the other is the generated mesh.

    http://imgur.com/a/VXKau
     
  29. Darkkingdom

    Darkkingdom

    Joined:
    Sep 2, 2014
    Posts:
    81
    Hey nuverian^^

    I got some performance issues.
    I have about 80 agents in my level and 25 obstacles.
    The most the obstacles have about 20 till 50 points and one is about 120 points.
    The performance is always bad (15FPS) even if no agent is walking around.

    Here is a screenshot with my profiler:
    (No agent walking around)



    Maybe you can get me a hint where I could search :)
    Thank you very much!
     
    Last edited: Apr 21, 2016
  30. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    I've been using a 2D pathfinding system (based on a tutorial series) but now when trying to add other agents it's not working as expected so I'm curious about Poly|Nav.

    The problem I'm having is the game is essentially a series of rooms. Some rooms have multiple agents, some just one. However, the automatic pathfinding is getting confused and trying to send agents to different rooms. With Poly|Nav can I define some 'bounds' (i.e. the room) in which they must pathfind and stay in?
     
  31. Marwadin33

    Marwadin33

    Joined:
    Feb 27, 2015
    Posts:
    1
    Hello! You asset has helped a lot, well done sir!

    I'm making a top down open world game, I don't want to create a grid for the whole map since its going to be too big, so my question is, is there a way to update the grid around the player ? That way I skip creating a grid for the whole map and since every thing outside the camera+ an offset is going to be disabled. Thanks
     
  32. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Sorry for late replies. It seems that I no longer get notifications for this thread somehow...

    Hello,
    Can you please send me a small project so that I can see exactly what might be the issue (support@paradoxnotion.com).
    Also, please try unchecking the "Invert Polygon" from the PolyNavObstacle component.
    Thanks and sorry for the late reply.

    Hello,
    Can you please try uncheck the "Restrict" option of the PolyNavAgents in the inspector and let me know?
    I will also take a look at that.
    Thanks!

    Hello,
    If an area of the navigation polygon is enclosed completely with obstacles (walls), if the agent is told to navigation to a point that it simply can't reach because of the wall obstacles of the room for example, then it will not try to pathfind at all and just retain i'ts current position.
    Let me know if that is what you mean.


    Hello and thanks :)
    There is unfortunately no such built in feature or any other way of segmenting navigation polygons. Also, to be honest, I am not sure if PolyNav is a well fit for a grid based open world game due to the vast amount of obstacles it will probably have and as such a low performance is probably due to take place. A grid-based solution might be a better fit, while PolyNav is not a grid-based one.
    Let me know if I can help you in any other way.
    Thanks.
     
  33. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    The rooms are not completely enclosed (i.e. you can go from one to the other) but I could add a gameobject without a collider to simulate the boundaries if that works?

    Hopefully this picture helps. The 'physical' (if this was the real world) rooms are in black, the boundaries that the agent (blue) will be able to explore are in red.



    Kind of like an art gallery - the rooms are all connected but each room has its own employee within it making sure you don't touch the things (or at least that's the case here).
     
  34. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Sorry for late reply.
    PolyNav works in a subtractive way. What I mean by that is that you create a big polygon which is walkable and then add obstacles (or holes) to that polygon. So, each wall has to be an obstacle, rather that each room being a walkable area. As an example, I have attached an image where the main navigation polygon is placed along with obstacles for each wall. An obstacle for the door is also placed here, which it's possible to disable/enable in runtime so that characters in the room will or not be able to move outside depending on whether the door obstacle is enabled or not.

    PN.png

    Let me know if that works for you.
    Thanks.
     
  35. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    How does this perform on mobile devices?
    Does it work for ios, android, and windows?

    If I were to create something like prison architect (
    ) with 50+ agents and doors opening and closing every few seconds, will be be slow? Ive read in previous post that regenerating the map is slow, is this still the case?
     
  36. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    I believe that I have encountered a bug in PolyNavAgent. If a PolyNavAgent is about to arrive at its destination, but we SetDestination just before that happens (maybe the exact same same frame) then the new SetDestination doesn't work. I believe this is a result of the SetDestination request being queued - then OnArrived/Stop gets called by the previous path finishing, which clears the SetDestination request that was just made.

    Anyhow, I haven't looked into this in much detail, but the fix on the client side that worked for me was to simply call polyNavAgent.Stop() before polyNavAgent.SetDestination() - this clears the old path that is about to finish.

    It was an annoying bug because it was hard to reproduce (player needs to click on new destination on exact frame that last path finished).
     
    Last edited: May 12, 2016
  37. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Thanks for your interest in PolyNav. I honestly believe that PolyNav will not be suitable for such a huge game that requires just rapid navigation map changes, since every change will regenerate the map and that will slow down the game considerably. Sorry :)

    Hey,
    Thanks a lot for the report. I will take a look and fix this accordingly!
     
  38. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    It seems that the checkbox "Regenerate On Change" in PolyNav2D does not get saved. Always reverts to being false. I don't think this is the desired behavior?

    I am able set the value when the game starts in code through "generateOnUpdate".
     
  39. KospY

    KospY

    Joined:
    May 12, 2014
    Posts:
    153
    This plugin seem great but it lack the possibility to set multiple map/graph using layer (something like A* pathfinding with multiple graphs).
    My game need differents pathfinding between multiple "space" (interior/exterior), I can't use polynav on my project because of this.

    Any hope of implementing this?
    Meanwhile, maybe it's possible to modify polynav to use two polynav2d script?
     
  40. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Everything seems to work fine on my end and the bool is not reverting. Could it be that you are setting the property from somewhere?

    Hello,
    This is the number one request of all times about PolyNav :) I will finally look into implementing multiple PolyNav2D maps within the coming week, yes. I hope this is not "far away" for your project.

    Thank you.
     
    Zelek likes this.
  41. KospY

    KospY

    Joined:
    May 12, 2014
    Posts:
    153
    Great new!
    Right now I'm using A* pathfinding but I plan to switch to Polynav as soon as possible.

    Thank you for your fast answer. I will keep an eye on this thread :)

    Edit : I have another request (lower priority than multiple PolyNav2D maps ;) ) : is it possible to set an extra obstacle offset for an agent with Polynav?
    My game has different unit size, and I need to avoid collision with big unit and/or allow small units to go throught narrow path.
     
    Last edited: May 20, 2016
  42. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    You are very welcome and thanks :)
    Regarding your 2nd request, unfortunately this is not possible at this time and I honestly can't tell for sure whether or not it will be implemented any time soon, but it is something that is in the queue as well.
     
  43. KospY

    KospY

    Joined:
    May 12, 2014
    Posts:
    153
    Another note about multiple polynav2d map : I think it will help greatly (at least for me) about performance.

    Right now every colliders is linked to one polynav2d so the generation is pretty long and "freeze" my game everytime an object is destroyed (my objects is containing an interior with tile based polynavobstacle).

    The freeze is linked to the method "LinkNodes(List<PathNode> nodeList)" and it take too long to handle approximativly 600 nodes (more than 350 000 iteration!).

    Right now I put this method in a coroutine with a WaitForFixedUpdate and I don't get freeze anymore but it slow down the game a little and I'm not sure it will be the best solution.

    Edit : As expected it broke the pathfinding during the generation, so I'm definitly need to wait multiple polynav2d map feature :)
     
    Last edited: May 21, 2016
  44. Zelek

    Zelek

    Joined:
    Jun 12, 2010
    Posts:
    87
    This is really great to hear, I've been hoping for this for a long time. I actually implemented multiple PolyNav2D instances in an old version, but it's been keeping me from upgrading because I don't want to have to keep doing it over and over again.

    Do you think the update will be released sometime this month?
     
  45. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hey,
    Yes, I remember your custom solution :). I will do my best to make it as soon as possible.
    Thank you.
     
  46. gumboots

    gumboots

    Joined:
    May 24, 2011
    Posts:
    298
    Heya!

    I found some comments on page four of this thread, specifically:

    http://forum.unity3d.com/threads/poly-nav-pathfinding-for-unity2d.224962/page-4#post-1817163

    Where you eventually said you'd implement the option to have multiple instances of PolyNav, and the ability to tell agents which nav they are a part of. Have you made any progress on this? I'm working on an adventure game, and want to avoid having different environments in different scenes, instead just turning environments on and off. (This would also involve teleporting the agent around.)

    I don't think this is currently possible in PolyNav, am I correct?
     
  47. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Hello,
    Unfortunately the feature is not yet implemented and is still in the works. Indeed what you are after would only be possible when the feature is implemented and unfortunately not possible right now.
    Thanks!
     
  48. jamez

    jamez

    Joined:
    Jun 17, 2014
    Posts:
    14
    I tested on a blank new project, so I know that it isn't being caused by setting the property myself. Actually, playing with it some more, it seems to just be that Unity doesn't consider the scene changed when "Regenerate On Change" is changed. So if I load a scene, change "Regenerate On Change", then go to another scene, Unity does not prompt me to save the changes made. Even if I manually choose File->Save, it still doesn't save the state. However, if I change the scene in some other way (say add a blank game object), then it saves "Regenerate On Change" correctly.

    So there is some weirdness going on there with how Unity is saving it. If other changes were made in the scene it might work correctly and you would never notice. But in my case, I made a change, tested it - it worked fine... but then a week later, I was testing the level and it had stopped working. Because it had never saved the changed last time.

    I know how to workaround it now, so I guess I'll chalk it up to a weird Unity inspector bug.
     
  49. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Thanks for the info. I will take a look at this and see if it's a PolyNav related issue or not.
     
  50. blober81

    blober81

    Joined:
    May 6, 2016
    Posts:
    97
    Hi,

    Just bought this asset but I can't find any video tutorials and when I open the files nodecanvas or playmaker I get all sorts of errors. Is there a video were they explain step by step how polynav works ? What I want is a spawning point for tanks that move to a certain direction and attack whatever enemies they find on their path.

    Any help is much apreciated