Advertisement
Guest User

NPCMove

a guest
Nov 24th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class NPCMove : MonoBehaviour {
  5.    
  6.     public Transform target;
  7.     NavMeshAgent agent;
  8.  
  9.  
  10.  
  11.    
  12.     void Start ()
  13.     {
  14.         agent = GetComponent<NavMeshAgent>();
  15.     }
  16.    
  17.     void Update() {
  18.        
  19.         agent.SetDestination(target.position);
  20.        
  21.     }
  22.    
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement