Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- namespace Assets.Script
- {
- public class EnemyController : MonoBehaviour
- {
- private GameObject playerCharacter;
- private CharacterController controller;
- private Vector3 _moveDirection = Vector3.zero;
- private float _speed=20.0F;
- private int _damage;
- private int _visibilityDistance;
- public void MoveTo()
- {
- controller = GetComponent<CharacterController>();
- _moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
- _moveDirection = transform.TransformDirection(_moveDirection);
- _moveDirection *= _speed;
- controller.Move(_moveDirection);
- }
- public void Attack() { }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement