Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

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

Photon×WebGL(5)サラリーマンに1人称カメラをつける

Last updated at Posted at 2020-12-17

やりたいこと

・サラリーマンにカメラを追従させる

05.jpg

--

カメラ追従くらい簡単そうなんだけど、、、
・1つのメインカメラしかないのに
・複数のプレーヤーインスタンスがいると、
・追従するのは、大変そう

--

実装手順

サラリーマンプレファブに2つのスクリプトを張り付ける
1)CameraWorkスクリプトを作成して
CameraWorkスクリプトは[6 - プレイヤーのカメラワーク]スクリプト全コピペ
2)PlayerManagerスクリプトも作成して
・PlayerManagerスクリプトは[7 - Player Networking]ページの真ん中よりちょっと上にあるカメラの制御スクリプトをコピペする
・void Start()部分だけしか書いてないけどそこだけあれば動くので大丈夫
![キャプチャ.JPG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/232643/732ed532-b638-171e-d14f-bae3a95d8f71.jpeg) ![キャプチャ2.JPG](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/232643/324ee00c-082f-d4a2-6c95-da85c9dbe14c.jpeg)

いい感じになるよ。

--
6 - プレイヤーのカメラワーク
7 - Player Networking
※日本語のWebページが分かりやすい。外国のWebページGoogle翻訳すると分かりにくい。。

次回:チャット(日本語入力対応)(★★★)

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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
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?