Advertisement
Pro_Unit

Enemy_MoveToPLayer

Jun 19th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.25 KB | None | 0 0
  1. public class Enemy: Monobehaviour
  2. {
  3.     public Transform player;
  4.     public float speedMove = 10;
  5.  
  6.     void Update ()
  7.     {
  8.         transform.position = Vector2.MoveTowards (transform.position, player.position, speedMove * Time.deltaTime);
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement