center
The center of the obstacle, measured in the object's local space.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Property
- Namespace: UnityEngine.AI
- Assembly: UnityEngine.AIModule
public Vector3 center { get; set; }
Remarks
Note: When a NavMeshObstacle is created the NavMeshObstacle.center is set to zero.
Examples
// 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); }}