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 5 years have passed since last update.

【Unity】webgl向けにビルドしたときのvectorのずれを直す方法

Posted at

現状

以下のソースを用いてprefabをインスタンス化しているのですが、Unity上で動かしたときとWeb上にアップロードした後でオブジェクトが作られる位置がずれてしまいます。
Unity上ではWebGLのデフォルトのサイズである960x600で作っており、index.htmlのstyleも960×600なのですがなぜずれてしまうのでしょうか?
また、直す方法はないでしょうか?

ソース
// prefabのkomaをインスタンス化する。
GameObject koma = (GameObject)Instantiate(obj,new Vector3(332,291.5,0),Quaternion.identity,komaParent);

▼Unity上で動かしたとき
無題1.png

▼Webサーバー上で動かしたとき
無題2.png

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?