Search Unity

Question NavMesh.SamplePosition manual recommended maxDistance question (possible typo)

Discussion in 'Navigation' started by R1PFake, Dec 25, 2021.

  1. R1PFake

    R1PFake

    Joined:
    Aug 7, 2015
    Posts:
    540
    I have a question about the Unity NavMesh.SamplePosition manual.

    "This function may reduce the frame rate if a large search radius is specified. To avoid frame rate issues, it is recommended that you specify a maxDistance of twice the agent height."

    Can someone explain why it is recommended to use twice the height?
    Or is that a typo and it should be twice the radius?

    https://docs.unity3d.com/ScriptReference/AI.NavMesh.SamplePosition.html
     
  2. med_tim

    med_tim

    Joined:
    Sep 27, 2021
    Posts:
    2
    same issue is there any other method can we use
     
  3. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300
    Unfortunately not afaik.
    Not sure why they use agent height as a reference, the agent radius would make a lot more sense imho.
    It's a pity that there is no more intelligent way to generate a valid NavMesh position.