Version: 2019.1
public Vector3 center ;

Description

The center of the obstacle, measured in the object's local space.

Note: When a NavMeshObstacle is created the center is set to zero.

// Default center is (0, 0, 0)
using UnityEngine;
using UnityEngine.AI;

public class ExampleScript : MonoBehaviour { void Start() { NavMeshObstacle navMeshObstacle = gameObject.AddComponent<NavMeshObstacle>(); Debug.Log(navMeshObstacle.center); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961