public int damage=50;
public float speed = 40;
private Transform target;
public void SetTarget(Transform _target)
{
this.target = _target;
}
private void Update()
{
transform.LookAt(target);
transform.Translate(Vector3.forward * Time.deltaTime * speed);
}
网友评论