Version: 2017.4
public Vector3 velocity ;

説明

障害物がナビメッシュの周りを移動する速度

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public AI.NavMeshObstacle obs; public Transform player; public float moveSpeed; void Start() { obs = GetComponent<AI.NavMeshObstacle>(); } void Update() { Vector3 targetPoint = player.TransformPoint(Vector3.forward * 5.0F); Vector3 heading = player.position - transform.position.normalized; obs.velocity = heading * moveSpeed; } }