Stuck on Marco Polo Tutorial

http://doc.exitgames.com/photon-cloud/M ... -tutorials

I got as far as the animation part. When I load 2 instances of unity, the client Doesn't move itself but DOES move the other player, same with the animation. Kind of the opposite of what should be happening. I double checked the tutorial over and over. I made sure to set _characterState public and isControllable public and false. I wrapped all of the input and animations it said to do in isControllable, except one thing I noticed that is different from the tutorial. in the tutorial it shows

var v = 0;
var h = 0;
if (isControllable) {
v = Input.GetAxisRaw("Vertical");
h = Input.GetAxisRaw("Horizontal");
}

in myThirdPersonController

but there is no

var v = 0;
var h = 0;

instead it is
if (isControllable) {
var v = Input.GetAxisRaw("Vertical");
var h = Input.GetAxisRaw("Horizontal");
}

which doesn't matter but makes me think maybe i downloaded a older version of the assets required?

Here is the way i set isControllable, and like I said its doing the opposite of what it should be doing. My character doesn't move or animate, but the other character on the server does, when i use input on my character. I'm stuck on this, because I'm really following the tutorial and its not working.

void OnJoinedRoom()
{
GameObject monster = PhotonNetwork.Instantiate("monsterprefab", Vector3.zero, Quaternion.identity, 0);
monster.GetComponent<myThirdPersonController>().isControllable = true;
}

Comments

  • We recently updated the Marco Polo Tutorial when we noticed the Asset Store "Monster" was changed again and got incompatible.
    The tutorial should link to a package that you can use and that should match the code in the text. Maybe some small things are changed like where the variable is defined, etc.

    If the "var v" part is in the block of "if (isControllable)", the values of v and h won't be available outside the block but that would imply they are not used at all?

    Can you please explain exactly: The locally instantiated character is not moving or animated, right? But the remote version if it is? Or is the input applied to the character of the other player?
    These two distinctions are very important, even if they don't look like it.
  • I was tired last night here is exactly what is happening. If I join my cloud. my local player can move around and animate. When I load a second instance. My local player stops moving, but keeps animating and moves and animates the remote player.

    Yes the Input from the local player is applied to the remote character when 2 players are loaded.

    Also I did use the monsters package from the tutorial not the asset store. I used 18 substances from the asset store.

    "Two more packages are required: "Monster" and "Eighteen Free Substances". Download and import these packages to the project."
  • This variant is very odd.
    Usually, the local character must move to update the remote one with new positions, etc. We don't really send input but the (animation) state and position/rotation.
    I don't know how this should ever happen...

    To help in this case, I'd have to look at the actual code. I got a lot on my plate, so I can't promise I can do something before Tuesday.
    Even if it's frustrating, you might want to start from scratch and re-do the tutorial.
    If that doesn't help, upload project somewhere and send me a link.
  • I probably will redo the tutorial. But I have successfully gotten the animations and position working in my own project, not the tutorial. So I at least learned from it. There is just something wrong with your current monster prefab I think, or I did something wrong. But here is where I left off on Marco, If you still want it. https://www.dropbox.com/s/qns4gv4ry4x5b94/Marco.rar
  • Interesting effect! :)
    I think the solution should be to re-do the paragraph "Fight for Control" in the tutorial.
    The CharacterControl in your project is active on all instances of the Monster. As result the local monster gets input and moves. It grabs the cam but after that, the remote monster is created (provided anyone is in the room already) and this in turn also has a active CharacterControl script. The remote monster is created later, so it successfully grabs the cam and also gets input. The cam follows the last created remote monster and that can't move, despite getting input, it also gets position updates from the owner, which doesn't move the monster.
    Once you added the myThirdpersonController, you can remove the CharacterController alltogether. Just make sure isControllable is set for the local instance but false by default.
Sign In or Register to comment.