Multiplayer Character Controller

Hey Guys,

I am making my first attempt at a multiplayer fps with Unity. Everything seems very straight forward, however I finally hit an issue that I don’t have the basic understanding to troubleshoot.

I am sure I just missed something small.
Any help is greatly appreciated! :slight_smile:
Here is what happens.

Player 1 connects.
Game network.instantiates prefab which include model, aimtarget, and private camera.
Player 1 can move his character around properly.
Player 2 connects.
Game network.instantiates a 2nd prefab copy which include model, aimtarget, and private camera.
Player 2 appears to have control over both models character controls.
While Player 2 sees and belives he is controling both models, Player 1 only sees Player 2’s model moving.
When Player 1 moves, he also appears to have control over both models, while player 2 only sees player 1 moving.

Side note: When a player witnesses the movement of the proper opposing players model, the animations are screwed up.

Also, the character is using the PlatformCharacterController.

*Before anyone asks, I have a main ‘GuiCamera’, and when the client connects, I switch to the instantiated camera. Granted, I am having issues with this as well. I use a ‘var MyView : Camera;’ on the instantiate script that points to the camera inside the prefab. It works fine until the 2nd player joins and take over the initial camera view. I think it is because it is public? And probably something related.

Sorry for the question!

Thanks!

When you let them press the A button to get setup, simply denote them as active players and store which controllers are active. Another option is to actually fix the character controller code supplied with PhysX since the full source is provided for it. I had a bit of a look today and it might take a while to track down the rotating issue, if ever.

Hi, I’m having the same problem, did you find a solution?

The script is probably just taking all input, with multiplayer you need to either filter out input from the wrong comtrollers (tacky) or direct input from each controller to the right player. I happen to be of the school believing that input should be an entirely distinct layer and object from the actors, but others disagree and make the actors poll input directly. Whichever solution you prefer the problem is probably the same.