Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

No valid Normal data in NavMeshHit

Discussion in 'Navigation' started by Kevin-LCF, Oct 10, 2017.

  1. Kevin-LCF

    Kevin-LCF

    Joined:
    Apr 12, 2013
    Posts:
    1
    When using NavMesh.SamplePosition to get NavMeshHit, there's no valid Normal data in result, which is always Vector3.zero. Anyone knows what's going on?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,744
  3. Wen-Li

    Wen-Li

    Joined:
    Nov 27, 2015
    Posts:
    4
    So do I. Anybody knows?
     
  4. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    299
    Did you ever figure this out? Just ran into the same issue and can't find much about it.
     
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    After all these years this is still a mystery. What purpose does navmeshhit.normal do? It's always Vector3.zero.

    And this is not documented properly. Anyone?
     
  6. hadynlander

    hadynlander

    Joined:
    Jan 24, 2014
    Posts:
    39
    It returns the normal of the NavMesh polygon boundary when NavMesh.Raycast gets a hit - i.e. the direction "away from" the boundary you hit, along the surface of the NavMesh.
     
  7. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    259
    This is handy for walking back from cliffs, which is exactly how I ended up on this thread.