ネットワーク上で各プレーヤーの出現位置をランダム化する






プレーヤーの出現をランダム化する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
public class RoomManager : MonoBehaviourPunCallbacks
{
// ★追加
public GameObject[] spots;
void Start()
{
// ★変更(どのスポットから出現するかはランダム)
PhotonNetwork.Instantiate("Player", spots[Random.Range(0,spots.Length)].transform.position, Quaternion.identity);
}
}



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





プレーヤーの出現をランダム化する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
public class RoomManager : MonoBehaviourPunCallbacks
{
// ★追加
public GameObject[] spots;
void Start()
{
// ★変更(どのスポットから出現するかはランダム)
PhotonNetwork.Instantiate("Player", spots[Random.Range(0,spots.Length)].transform.position, Quaternion.identity);
}
}



ネットワーク上で各プレーヤーの出現位置をランダム化する