0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【測域センサ・Unity】transform.position assign attempt for 'Cube' is not valid. Input position is { NaN, NaN, NaN }

Posted at

サンプルのシーンでは検出が上手くいくが...

Github上などでヒットする測域センサとUnityの連携に関するプロジェクトですが、サンプルで用意されているシーン上では上手く稼働していても、他のシーンで稼働させようとするとエラーが発生するといった場合、この記事が役立つかもしれません。

エラー内容

DebugRenderer.cs エラー
transform.position assign attempt for 'Cube' is not valid. Input position is { NaN, NaN, NaN }

謎エラーです。
検知した位置にオブジェクトを移動させる処理でエラーが発生しています。
本来であればポジションの引数にfloat型をセットするはずですが、NaNとなっています。

解決策

Unity上のMainCameraの角度(回転)を下記のようにしてください。

X : 90度
Y : 0度
Z : 0度

これでエラーが解消されるはずです。
DebugRenderer内でカメラのオブジェクトから何か情報を取得しているので、それが関係しているかもしれません。
角度をこれ上記以外のものにすると基本的にエラーが発生します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?