ネットワーク上でCinemachineを使えるようにする





Followを動的に設定する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 追加
using Photon.Pun;
using Cinemachine;
public class PlayerCamController : MonoBehaviourPunCallbacks // 変更
{
private void Awake()
{
if(photonView.IsMine)
{
// 自己の画面内にあるCinemachineを「名前で」探して情報を取得する。
var cmv = GameObject.Find("CMV");
// 自己をFollow対象に設定する。
cmv.GetComponent<CinemachineVirtualCamera>().Follow = this.transform;
}
}
}

【2021版】BattleOnline(全37回)
他のコースを見る




Followを動的に設定する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// 追加
using Photon.Pun;
using Cinemachine;
public class PlayerCamController : MonoBehaviourPunCallbacks // 変更
{
private void Awake()
{
if(photonView.IsMine)
{
// 自己の画面内にあるCinemachineを「名前で」探して情報を取得する。
var cmv = GameObject.Find("CMV");
// 自己をFollow対象に設定する。
cmv.GetComponent<CinemachineVirtualCamera>().Follow = this.transform;
}
}
}

ネットワーク上でCinemachineを使えるようにする