Advertisement
Guest User

AIpet

a guest
Apr 18th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class AIpet : MonoBehaviour
  6. {
  7. public Transform player;
  8. public float moveSpeed;
  9.  
  10. // Update is called once per frame
  11. void Update()
  12. {
  13. transform.LookAt(player);
  14. transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement