Skip to content

Instantly share code, notes, and snippets.

@KangYoosam
Created November 6, 2016 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KangYoosam/ad492d28299ce0f9aaf1dd9966f431fd to your computer and use it in GitHub Desktop.
Save KangYoosam/ad492d28299ce0f9aaf1dd9966f431fd to your computer and use it in GitHub Desktop.
Navmeshでターゲットの方向へ向かっていく
public class Move : MonoBehaviour {
public GameObject target;
void Start () {
NavMeshAgent agent = GetComponent<NavMeshAgent> ();
agent.speed = 1;//このようにスクリプトからNavMeshのプロパティをいじれる。
agent.destination = target.transform.position;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment