Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Weird agent angle at OffmeshLink

Discussion in 'Navigation' started by mistergreen2016, Feb 21, 2019.

  1. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    Hey, I'm creating my own animation at the OffmeshLink, so I turned off autoTraverse. The problem is when the agent reaches the OffmeshLink, the angle is messed up. Noticed the forward (Z) is point down so it mess up my animation. It should be forward to where (Y) is now.






    I don't know how to fix this problem.
     
  2. mistergreen2016

    mistergreen2016

    Joined:
    Dec 4, 2016
    Posts:
    226
    I finally found a hack. I store the rotation before reaches the link, then set the current rotation to that old rotation.
     
  3. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
    Late to the party, but there is also the updateRotation method on the agent, which you can set to false while you're on the link.