Logo
  • Assets
  • Contact
  • About
  • Forums
  • Login

[Bug] Seek task ignores 'autoTraverseOffMeshLinks' when its branch fails

Forums › 💬 NodeCanvas › ⚙️ Support › [Bug] Seek task ignores 'autoTraverseOffMeshLinks' when its branch fails

  • This topic has 0 replies, 2 voices, and was last updated 5 years, 7 months ago by mallninjamax.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 2, 2020 at 7:31 am #16125
    mallninjamax
    Participant

      In my minimal recreation, I’m on a NavMesh island with no access other than the one link, and “autoTraverseOffMeshLinks” is set to false on the NavMeshAgent component. I have a simple branch that checks a bool that I set manually, and a seek action. When it first fires, the agent approaches the OffMeshLink and waits as expected. Moving that GameObject didn’t cause it to ignore the auto traverse. Similarly, when I set my player as the Gameobject, same result. However, the moment I set the arbitrary bool to false, and the branch fails, the agent immediately teleports across the OffMeshLink.

      September 2, 2020 at 7:20 pm #16127
      mallninjamax
      Participant

        Updating this as I’m looking into it. It seems calling the ResetPath() function causes this to happen. It’s called in the OnStop() method for the task.

        This is pretty critical for my core gameplay loop, so I’m going to try and fix it. When I find something I think works and doesn’t ruffle too many feathers, I’ll post it. I still welcome any developer input on this.

        Update: I found a way that I think will work for me for now. Just before the path is reset, I warp the agent to it’s current position:

        1
        2
        3
        4
        5
        6
        7
        8
        9
        protected override void OnStop()
        {
            if(lastRequest != null && agent.gameObject.activeSelf)
            {
                agent.Warp(agent.transform.position);
                agent.ResetPath();
            }
            lastRequest = null;
        }
        September 16, 2020 at 1:46 am #16126
        Gavalakis
        Keymaster

          Hello and sorry for the late reply.
          Thank you for your details provided, as well as the smart hack/fix 🙂
          I don’t see any problems with doing that, thus I will also add it officially for the next version update (in all navmesh related actions) so that you don’t have to worry about adding this every time you update 🙂
          I will however also try to find an alternative solution if possible.

          Thanks!

        • Author
          Posts
        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.
        Log In

        Footer Logo

        Home | Contact | Privacy Policy
        Twitter | Discord | YouTube
        Paradox Notion

        • Login
        • Register
        Forgot Password?
        Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
        body::-webkit-scrollbar { width: 7px; } body::-webkit-scrollbar-track { border-radius: 10px; background: #f0f0f0; } body::-webkit-scrollbar-thumb { border-radius: 50px; background: #dfdbdb }