get_time can only be called from the main thread.のエラーがコンソールに出ました!


問題なく動くのですが、以下エラーがコンソールに出ます。

誰かご教授をお願いします。

床を動かすプログラムです。
ソースは
*********************************************
private var nowPosition : Vector3;

function Awake() {
nowPosition = transform.position;

}

function Update() {
var offs = Vector3(Mathf.Sin(Time.time),0,0);
transform.position = nowPosition + offs;

}

var offs = Vector3(Mathf.Sin(Time.time),0,0) * 4;
**********************************************

! get_time can only be called from the main thread.
  Constructors and field initializers will be executed from the loading thread when loading a scene.
  Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

! ArgumentException: get_time can only be called from the main thread.
  Constructors and field initializers will be executed from the loading thread when loading a scene.
  Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  UpDownMove..ctor () (at Assets/JavaScript/UpDownMove.js:17)


コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です


トラックバックURL:
http://port17.net/unity/%e5%82%99%e5%bf%98%e9%8c%b2/get_time-can-only-be-called-from-the-main-thread-%e3%81%ae%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e3%82%b3%e3%83%b3%e3%82%bd%e3%83%bc%e3%83%ab%e3%81%ab%e5%87%ba%e3%81%be%e3%81%97%e3%81%9f%ef%bc%81/trackback/