(スクリプト)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Jack2 : MonoBehaviour
{
public GameObject target;
void Update()
{
transform.position = Vector2.MoveTowards(transform.position, target.transform.position, 3 * Time.deltaTime);
}
}
(設定)
- スクリプトをオブジェクトに追加
- ターゲットを設定

- 設定が完了したらゲーム再生
- ターゲットをどこまでも追いかければ成功です。

