Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. public class AIBrain : MonoBehaviour
  2. {
  3.     public NavMeshAgent agent;
  4.     public VisionTrigger visionTrigger;
  5.  
  6.  
  7.     private Transform target;
  8.  
  9.     // Use this for initialization
  10.     void Start ()
  11.     {
  12.        
  13.     }
  14.    
  15.     // Update is called once per frame
  16.     void Update ()
  17.     {
  18.         target = visionTrigger.Target;
  19.  
  20.         if(target != null)
  21.         {
  22.             agent.SetDestination(target.position);
  23.         }
  24.        
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement