ここで助けが必要です。raycastでブロックされていないネイバーを検索するコードの一部があります。「WP」タグと衝突するレイキャストを取得する必要があります。どちらの反復も正しい結果を示したので、ダンプとレイキャストを実行すると、レイキャストは何かを衝突させることに成功しますが、レイキャストが衝突したものを確認すると、結果は表示されません....これの何が問題なのか誰もが知っていますコード..??
int flag = 0, flahNeigh = 0;
for(flag = 0; flag< wayPoints.WPList.Length; flag++) // iteration to seek neighbour nodes
{
for (flagNeigh = 0; flagNeigh < wayPoints.WPList.Length; flagNeigh++)
{
if (wayPoints.WPList[flag].loc != wayPoints.WPList[flagNeigh].loc) // dump its own node location
{
if (Physics.Raycast(wayPoints.WPList[flag].loc.position, wayPoints.WPList[flagNeigh].loc.position, out hitted)) // raycasting to each node else its self
{
if (hitted.collider.gameObject.CompareTag("WP")) // check if the ray only collide the node
{
print(flag + " : " + flagNeigh + " : " + wayPoints.WPList[flagNeigh].loc.position); // debugging to see whether the code works or not (the error comes)
}
}
}
}
}
感謝と答えをありがとう...私が悪い英語を持っているならごめんなさい...^^