Created
November 29, 2016 01:18
-
-
Save Templar2020/d9209cab835d5bf173c5245819b3aeaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class follow : MonoBehaviour { | |
public Rigidbody enemy; | |
public float moveSpeed; | |
public Transform target; | |
void Update(){ | |
transform.LookAt(target); | |
transform.Translate(Vector3.forward*moveSpeed*Time.deltaTime); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment