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

NavMeshAgent rotating issue, Please help me

Discussion in 'Navigation' started by jina95121111, Aug 23, 2019.

  1. jina95121111

    jina95121111

    Joined:
    May 10, 2019
    Posts:
    1
    Hello.
    In the game I'm making, I use Navmesh(baked), and I set the NavMeshAgent on the player.
    I used NavMeshHit instead of raycast, and when I click, it moves. And I use Event Trigger for this.

    Also, in the start function, I have this code.
    "agent.destination = goal.position;" ( NavMeshAgent agent / Transform goal)
    I don't place any model to this goal because the player doesn't move towards an object, it's moving to the part that I click on.
    There's nothing wrong with it, and it's actually working fine.

    So I tried to erase that line.
    But (This is the problem) If I delete it, the rotation will not work correctly.
    It moves well but doesn't rotate to the place, so it looks as if the player is moving sideways.
    Do you know why this is happening?

    Thank you.
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    That's strange. Have you made sure the "forward" direction of your object matches your art asset's "forward direction"?