[SOLVED] Can't move when two players are connected

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

[SOLVED] Can't move when two players are connected

Kobaltic
2017-01-06 01:04:58

I am following this tut:

doc.photonengine.com/en-us/truesync/current/tutorial/tstutorial-part1-download-install

I just finished the 2nd page of the tut. When I run it in the editor the player moves just fine. When I run it in the standalone client the player moves just fine.

When I run two standalone clients, it starts up just fine. I get players 1 then they both change to 2 when the second player joins. I hit the start button and player 1 spawns but that is it. I can't move player 1 and nothing spawns on the player 2 screen. Player 2 does not spawn on client 1 either. If I disconnect one of the players it then picks up and works just fine with the correct player number.

When I run it in the editor and a standalone, They both just show 1 player and both have the start button. I can control either player depending on which one I am in. It seems as if both are the master client.

I redid my app ID just in case it was wrong and wasn't connecting to my server. I rebuild the client (several times) and then immediately tried the editor and the client but it still did not work.

EDIT:
SOLUTION:
Turns out the tut is wrong. I downloaded the working demo and figured it out. On page one of the tut towards the bottom of the page. There is the OnGUI part of the script. It as this in it:
PhotonNetwork.automaticallySyncScene = true;

Seemed kinda odd to be there to me. Turns out is wrong in belongs in the Start() function.
should be:

void Start()
{
PhotonNetwork.automaticallySyncScene = true;
PhotonNetwork.ConnectUsingSettings("v1.0");
}

Also there is a typo on page 3 towards the bottom:

projectile.owner; = owner;

there is an extra semi colon before the = sign

Comments

JeffersonHenrique
2017-01-06 12:58:07

Thanks @Kobaltic, we will check the tutorial and make the proper adjustments.

Maccu
2017-01-10 19:42:18

I can confirm this too. Also would be nice if the (Link?) actually linked to the next page ;)

Back to top