Advertisement
MrsMcLead

Enemy AI

Feb 8th, 2018
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EnemyAI : MonoBehaviour {
  6.     public Transform player;
  7.     public float speed;
  8.     // Use this for initialization
  9.     void Start () {
  10.        
  11.        
  12.     }
  13.    
  14.     // Update is called once per frame
  15.     void Update () {
  16.         transform.LookAt (player);
  17.         transform.position += transform.forward * speed * Time.deltaTime;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement