(スクリプト)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HeriRootGo : MonoBehaviour
{
public GameObject[] points;
private int num = 0;
void Update()
{
transform.Translate(Vector3.forward * Time.deltaTime * 1);
// ヘリとポイントの高さを揃える(ポイント)
transform.LookAt(points[num].transform);
float dis = Vector3.Distance(transform.position, points[num].transform.position);
if(dis < 2)
{
num = (num + 1) % points.Length;
}
}
}
(実行結果)