【3Dゲームエンジン】Unity質問スレッド10at GAMEDEV【3Dゲームエンジン】Unity質問スレッド10 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト1090:名前は開発中のものです。 14/09/11 15:06:21.39 oiJ7XQQzn unityでドラえもんのコエカタマリンみたいなモノを表示させたいのですが、 どうすれば良いのでしょうか? 元からある3Dtextだとペラペラなので雰囲気が出ません。 よろしくお願いします。 1091:名前は開発中のものです。 14/09/15 15:58:14.83 rgyLMh7fT オブジェクトを(まずはマウスクリックで)ドラッグ&ドロップでXZ平面上に配置できるようにしたいです。 以下のスクリプトをオブジェクトに与えて再生し、オブジェクトをクリックするとY軸方向にも移動してしまう現象をXZ平面上のみ移動するように修正したいのですが、どうすればいいかわかりません。 private Vector3 screenPoint; private Vector3 offset; void OnMouseDown() { screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position); offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z)); } void OnMouseDrag() { Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z); Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset; transform.position = curPosition; } } 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch