Version: 2023.2
언어: 한국어
public Vector3 size ;

설명

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

The size will be scaled by the transform's scale.

using UnityEngine;
using UnityEngine.AI;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { NavMeshObstacle obstacle = GetComponent<NavMeshObstacle>(); Mesh mesh = GetComponent<MeshFilter>().mesh; obstacle.shape = NavMeshObstacleShape.Box; obstacle.size = mesh.bounds.size; } }