Forum rules - please read before posting.

open 2D door - Polygon Collider Pathfinding

Hello, 
I have this NavMesh in my scene:
image

The player has to collect some objects and combine them before the door (well.. the gate) opens and he can pass through.
I'm looking for a way to stop the player to go through. 
I searched the forum a lot and read all the door tutorials, I tried several approaches but I cannot make it work.
What's the best way to do this?
- substitute the NavMesh
- make a Hole in the NavMesh and then remove it
- use a NavMesh Obstacle
- put a Hotspot over the whole blocked part so the user cannot click there (as the 2D example)
- ...
The Hotspot seems the best way to do this, but since I will have a clickable NPC just near the gate I cannot put the Hotspot to completely block the player to go through. 
What do you suggest?

Comments

  • For now, the best way would be to create another NavMesh that only covers the left-half.  I'll be looking into ways to improve this workflow, however.
  • Update: The "hole" system is kind of misleading, it turns out - because Unity will add the shape of the hole to the navmesh if it goes outside the boundary of the original.  So the best way to do this would be to create two navmeshes: one for left, one for right, and add the right one as a hole of the left when the gate opens:

    image
  • Thanks for pointing that out. 
    I succesfully created this scene using two nav meshes. 
    When the gate is open the left navmesh is substituted with another "complete" one, and the exit hotspots on the right are disabled.
    image

  • edited June 2016
    Hi,
    Im having a quite serious problem with this sollution ...
    (during changing of navmesh there is annoying lag - for about 2 seconds everything freezes on stage).
    Will this be fixed in next updates ? of Adventure Creator ?
    (It seems that every time when change in navmesh is occuring there is a lag - i'v tried also changing numer of holes but in that case lag is similair).
    Im using quite big 2D navmesh (about 2600 pixels wide per 1800 high).
    May that be problem with size of area im trying to change ?

    I will be verry thankfull for fast ansver.

  • Its a bit better when You add another hole (as solution aditional walking area) - instead of changing of all nav mesh but still a bit of lag.
    I hope this can be improved.
    Thanks

  • The pathfinding algorithm for 2D games is scaleable, so that you can alter the speed/quality ratio to suit your needs.

    Reducing the Accuracy slider in the Navigation Mesh component will improve the speed, but you'll need to do a bit of playtesting to find the best value - too low and characters will sometimes not walk around obstacles correctly.  You can also set Character evasion to None for an additional performance boost.
  • edited June 2016
    Great ! 
    Now it works just perfect ;]
    (I'v reduced accuracy to 0.35) and loading speed is unoticeable :D

    By the way this engine is great (im already working on big game - it will be quite loud about it in few months).
    and im having toons of ideas during learning of engine for next ones - even not classical point and clicks.

    thanks for great job on this tool Chris !

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.