Version: 5.4
public Vector3 velocity ;

説明

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

using UnityEngine;
using System.Collections;

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