Advertisement
kasru

NavMesh Ai

May 31st, 2014
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. #pragma strict
  5.  
  6. var target : Transform;
  7. var navComponent : NavMeshAgent;
  8.  
  9. function Start () {
  10.  
  11.     navComponent = this.transform.GetComponent(NavMeshAgent);
  12.  
  13. }
  14.  
  15. function Update () {
  16.  
  17.     if(target) {
  18.    
  19.         navComponent.SetDestination(target.position);  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement