言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

NavMesh.SamplePosition

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function SamplePosition(sourcePosition: Vector3, hit: NavMeshHit, maxDistance: float, allowedMask: int): bool;
public static bool SamplePosition(Vector3 sourcePosition, NavMeshHit hit, float maxDistance, int allowedMask);
public static def SamplePosition(sourcePosition as Vector3, hit as NavMeshHit, maxDistance as float, allowedMask as int) as bool

Parameters

sourcePosition クエリとなるサンプルの原点
hit 一番近い辺のヒット情報
maxDistance サンプリングされるsourcePositionからの距離
allowedMask 最も近い位置を見つける時に特定のマスクをかけるためにナビメッシュレイヤーを渡すことが出来る

Returns

bool 最も近い点が見つかった場合はtrue

Description

特定の位置に最も近いナビメッシュオブジェクトをサンプリングします