I want to create multiple spectator for multiplayer gaming.
how can I do?
I tried to use network view, but how to set it?
this is my script, but it does not work, because every time a new player join the game unity creates a new camera, which becomes the maincamera for all players.
You need to make an updater, you will need to add tag to both the Player being spectated and your camera
`var playerx : Int
var playery : Int
var playerz : Int
var Xoffset : Int
var Yoffset : Int
var Zoffset : Int
var CurrentPlayer : Int
function Update()
if (CurrentPlayer == 1)
{
var POS1 = GameObject.FindWithTag(“PlayerPos”); //being spectated
playerx = POS1.transform.position.X
playery = POS1.transform.position.y
playerz = POS1.transform.position.z
var POS = GameObject.FindWithTag(“CameraToSee”); //set the camera
POS.transform.position = Vector3(playerx + Xoffset,playery + yoffset,playerz + Zoffset) // make the cam go here
}
{
` i hope this help, tell me if there is any errors (REMEMBER TO BACKUP YOUR CURRENT CODE)