- Home /
how to ignore offmesh linked staircase when approaching from backside of stairs?
I am creating a 2.5D game where the player can create stairs that then become an offmesh link between the floor and a second platform that the stairs connect to. prior to implementing navigation I had code in place where the AI characters would pass through the stairs if approaching from the backside but now with the navigation in place im not sure how to have this same functionality. The stairs and offmesh link must stay active since other AI characters may be using them, only the characters approaching from behind the stairs should pass through. I also need help on how to have the pathfinding understand that they can pass through the stairs and not see it as an obstacle. Thanks in advance for any help!
Answer by slavo · Feb 02, 2017 at 10:27 AM
Disabling BiDirectional checkbox on Offmeshlink, should do what you want.
https://docs.unity3d.com/Manual/class-OffMeshLink.html
Bi-Directional - If enabled, the link can be traversed in either direction. Otherwise, it can only be traversed from Start to End.
but what if another agent needs to go up or down the stairs at that same time? wouldnt disabling bidirectional interfere their ability to do so?
Sorry, I misunderstand your question. You need bidirectional offmesh link if you want them to go from both sides. Can you provide me more info about your setup and what you want to achive? Picture would be nice.
Your answer
Follow this Question
Related Questions
Changing only vertical speed on NavMeshAgent? 0 Answers
how to modify values of automatically generated offMesh link? 0 Answers
I have used navmesh plus multiple times, can't figure out why it isn't working in this project 0 Answers
How to find where a navagent will be? 1 Answer
NavMesh.Raycast and Physics.Raycast never hit NavMesh 1 Answer