Need help with photon!

Hi!
When i’m starting my project im getting down under the terrain… heres a video:

heres the code:

using UnityEngine;
using System.Collections;

public class NetworkManager : Photon.MonoBehaviour {

	// Use this for initialization
	void Start () {
		PhotonNetwork.ConnectUsingSettings("alpha 0.1");
	}
	
	void OnGUI () {
		GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString())  ;
	}
	
	void OnJoinedLobby () {
		PhotonNetwork.JoinRandomRoom();
	}
	
	void OnPhotonRandomJoinFailed () {
		PhotonNetwork.CreateRoom(null);
	}
	
	void OnJoinedRoom () {
		GameObject Player = PhotonNetwork.Instantiate ( "Player", Vector3.zero, Quaternion.identity, 0 );
	}
}

If i finish this my dream would come true, thankful for help guys :slight_smile:

picture on the “Hierachy”:
1354490--66921--$estra.PNG

First thing I would do is instantiate your character at a specific spot. Instead of just vecto3.zero, do this:

Public Tranform spawnPoint;

Then create an empty game object in your scene and name it spawn point and drag it onto this variable in the inspector.
Then drag your spawn point game object in your scene where ever you want to spawn.
Finally use:

PhotonNetwork.instantiate(prefab, spawnpoint.position, quaternion.identity, 0)

Sorry for typos I’m on mobile.

Also make sure your spawnpoint game object is above the ground so you don’t drop through the floor.

You have a photon view on your player prefab of course right?
And of course make sure you have a collider on your player and the floor so you don’t fall through.

Okay gonna test it! If it works, omg dude then thank you so much, contacting you soon :slight_smile:

I don’t have photonview on my character, but i will add it when i fixed my error, says “Parsing Error CS8025”
and the code is here:

using UnityEngine;
using System.Collections;

public class NetworkManager : Photon.MonoBehaviour {

	void Start () {
		PhotonNetwork.ConnectUsingSettings("alpha 0.1");
	}
	
	void OnGUI () {
		GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString());
	}
	
	void OnJoinedLobby () {
		PhotonNetwork.JoinRandomRoom();
	}
	void OnPhotonRandomJoinFailed () {
		PhotonNetwork.CreateRoom(null);
	}
	void OnJoinedRoom () {
		PhotonNetwork.Instantiate(prefab, spawnpoint.position, quaternion.identity, 0);
	{
	
}

Line 22.