Skip to content

format

typescript
NavMeshObstacle.radius

class: NavMeshObstacle

description

The radius of the cylinder.

When the shape is set to Cylinder, this property sets the radius of the cylinder. It is illegal to read or write the radius property when the shape is not set to Cylinder.

parameter

param_nametypedescription

reture

typedescription
numberThe radius of the cylinder.

code example

typescript
let obj = new GameObject();
let com = obj.AddComponent<NavMeshObstacle>(NavMeshObstacle);
com.shape = NavMeshObstacleShape.Cylinder;
com.radius = 0.5;
Debug.Log("NavMeshObstacle: radius = ", com.radius);