Answers for "unity3d find y position on navmesh"

C#
0

unity3d find y position on navmesh

private bool SetDestination(Vector3 targetDestination)
{
  NavMeshHit hit;
  if (NavMesh.SamplePosition(targetDestination, out hit, 1f, NavMesh.AllAreas))
  {
    agent.SetDestination(hit.position);
    return true;
  }
  return false;
}
Posted by: Guest on May-27-2020

C# Answers by Framework

Browse Popular Code Answers by Language