Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AIBrain : MonoBehaviour
- {
- public NavMeshAgent agent;
- public VisionTrigger visionTrigger;
- private Transform target;
- // Use this for initialization
- void Start ()
- {
- }
- // Update is called once per frame
- void Update ()
- {
- target = visionTrigger.Target;
- if(target != null)
- {
- agent.SetDestination(target.position);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement